You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Enable parallel query with SERIALIZABLE isolation.
Previously, the SERIALIZABLE isolation level prevented parallel queryfrom being used. Allow the two features to be used together bysharing the leader's SERIALIZABLEXACT with parallel workers.An extra per-SERIALIZABLEXACT LWLock is introduced to make it safe toshare, and new logic is introduced to coordinate the early releaseof the SERIALIZABLEXACT required for the SXACT_FLAG_RO_SAFEoptimization, as follows:The first backend to observe the SXACT_FLAG_RO_SAFE flag (set bysome other transaction) will 'partially release' the SERIALIZABLEXACT,meaning that the conflicts and locks it holds are released, but theSERIALIZABLEXACT itself will remain active because other backendsmight still have a pointer to it.Whenever any backend notices the SXACT_FLAG_RO_SAFE flag, it clearsits own MySerializableXact variable and frees local resources so thatit can skip SSI checks for the rest of the transaction. In thespecial case of the leader process, it transfers the SERIALIZABLEXACTto a new variable SavedSerializableXact, so that it can be completelyreleased at the end of the transaction after all workers have exited.Remove the serializable_okay flag added to CreateParallelContext() bycommit9da0cc3, because it's now redundant.Author: Thomas MunroReviewed-by: Haribabu Kommi, Robert Haas, Masahiko Sawada, Kevin GrittnerDiscussion:https://postgr.es/m/CAEepm=0gXGYhtrVDWOTHS8SQQy_=S9xo+8oCxGLWZAOoeJ=yzQ@mail.gmail.com