-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/5582~1
head repository: postgresql-cfbot/postgresql
compare: cf/5582
- 5 commits
- 4 files changed
- 2 contributors
Commits on Feb 18, 2025
-
Demonstrate crash in brininsertcleanup during logical replication.
A cross-partition update crashes if the subscriber's table has a BRIN index. This is easily demonstrated by adding such an index to 013_partition.pl. I'm not sure if we actually want to include this in the final patchset, so it's a separate patch for now. Bug: #18815 Reported-by: Sergey Belyashov <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: TBD
Configuration menu - View commit details
-
Copy full SHA for 9296ccf - Browse repository at this point
Copy the full SHA 9296ccfView commit details -
Harden brininsertcleanup against repeat calls.
Leaving an empty BrinInsertState struct linked in ii_AmCache confuses both brininsertcleanup itself and brininsert, were that to be called again. We should fully remove it, instead. This stops the crash reported in bug #18815. I think it's fixing the symptom rather than the root cause, but nonetheless there's little argument for brininsertcleanup to be leaving an obviously broken data structure behind. Bug: #18815 Reported-by: Sergey Belyashov <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: TBD
Configuration menu - View commit details
-
Copy full SHA for 66102d0 - Browse repository at this point
Copy the full SHA 66102d0View commit details -
Assert that ExecOpenIndices and ExecCloseIndices are not repeated.
These functions should be called at most once per ResultRelInfo; it's wasteful to do otherwise, and certainly the pattern of opening twice and then closing twice is a bad idea. Moreover, index_insert_cleanup functions might not be prepared to be called twice, as the just-hardened code in BRIN demonstrates. Sadly, logical replication's apply_handle_tuple_routing() does exactly that, meaning that either hunk of this patch is sufficient to make it crash. While other patches in this series are back-patch candidates, this one should only be applied to HEAD, as perhaps there are extensions doing the now-forbidden coding pattern. We shouldn't break them in minor releases. Bug: #18815 Reported-by: Sergey Belyashov <[email protected]> Discussion: https://postgr.es/m/[email protected]
Configuration menu - View commit details
-
Copy full SHA for 8d80010 - Browse repository at this point
Copy the full SHA 8d80010View commit details -
Avoid duplicate ExecOpenIndices/ExecCloseIndices in logrep worker.
During a cross-partition update, apply_handle_tuple_routing calls ExecFindPartition which does ExecOpenIndices (and expects that ExecCleanupTupleRouting will close the indexes again). Therefore, we must avoid re-opening/closing the table's indexes when the update code path calls apply_handle_insert_internal or apply_handle_delete_internal. That leaves us with only one caller of each function that needs indexes to be opened/closed, so we can just move those calls to the callers. Also, remove the entirely-duplicative open/close calls within apply_handle_tuple_routing itself. Bug: #18815 Reported-by: Sergey Belyashov <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: TBD
Configuration menu - View commit details
-
Copy full SHA for 26e7709 - Browse repository at this point
Copy the full SHA 26e7709View commit details -
[CF 52/5582] v1 - fix for bug #18815
This commit was automatically generated by a robot at cfbot.cputube.org. It is based on patches submitted to the PostgreSQL mailing lists and registered in the PostgreSQL Commitfest application. This branch will be overwritten each time a new patch version is posted to the email thread, and also periodically to check for bitrot caused by changes on the master branch. Commitfest entry: https://commitfest.postgresql.org/52/5582 Patch(es): https://www.postgresql.org/message-id/[email protected] Author(s):
Commitfest Bot committedFeb 18, 2025 Configuration menu - View commit details
-
Copy full SHA for bc02368 - Browse repository at this point
Copy the full SHA bc02368View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/5582~1...cf/5582