This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor SaveOidAssignments and RestoreOidAssignments logic.
The two functions SaveOidAssignments and RestoreOidAssignments should come together, before some procedures that do not want to touch the global vars (dispatch_oids or preassigned_oids), we need to first save the oid assignments, and then do the job, finally restore oid assignments. A typical usage should be as below: List *l = SaveOidAssignments(); do_the_job(); RestoreOidAssignments(l); The global var dispatch_oids is only used on QD, and the global var preassigned_oids is only used on QEs. They are both Lists, in a specific memorycontext, normally the memorycontext will be reset at the end of transaction. Greenplum's MPP architecture need to make some OIDs consistent among coordinator and segments (like table OIDs). The oid assignments are generated on QD and then dispatched to QEs. A single SQL might involve sever dispatch events, for example, there are some functions involving SQLs and these functions are evaluated during planning stage before we dispatch the final Utility plan. We do not want to the dispatches during plannign stage to touch oid assignments. Another subtle case that the pair of functions are useful is that subtransaction abort will lead to reset of the oid assignments memory context. Subtransaction abort might happen for UDF with exception handling and nothing to do with the main statement needed to dispatch. That is why we deep copy the content to CurrentMemoryContext and reset oid assignment context during SaveOidAssignments and bring everything back during RestoreOidAssignments. This commit adds the two functions before eval_constant_expressions() to make sure the procedure does not touch oid assignments. Fix issue: greenplum-db/gpdb#14465. (cherry picked from commit c89ae81)
- Loading branch information
Showing
6 changed files
with
119 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters