Repository navigation
Fix crash when merging chunks with different column layouts - #10667
Conversation
|
@pnthao, @kpan2034: please review this pull request.
|
Codecov Reportβ Patch coverage is
π’ Thoughts on this report? Let us know! |
fc65466 to
9c5c643
Compare
| /* Exclusive lock so that hint bits get set, which the rewrite needs */ | ||
| LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); |
There was a problem hiding this comment.
I don't understand this, can you explain more? Looks like heapam_relation_copy_for_cluster uses only BUFFER_LOCK_SHARE. The hint bits are only an optimization for reading, why is it important here?
There was a problem hiding this comment.
This is copied from pg source, older versions used BUFFER_LOCK_SHARE but pg19 uses BUFFER_LOCK_EXCLUSIVE
There was a problem hiding this comment.
made this conditional per pg19
| NULL, | ||
| false, | ||
| cutoffs->OldestXmin, | ||
| if (map != NULL) |
There was a problem hiding this comment.
If it's easy to make your new function apply an "empty map", consider running it always, and not running table_relation_copy_for_cluster at all. The mismatched layout is relatively rare, so this function won't be called often in the current approach, and might have rare bugs. If we call it always, it will be better covered.
There was a problem hiding this comment.
This is supposed to be fastpath so not a fan of removing it
b7fa558 to
57fcbdb
Compare
Chunks created before and after a column was dropped have different physical column layouts. Merging such chunks copied rows by column position, which crashed or corrupted data. Rows are now converted by column name when the layouts differ. Fixes #10665
57fcbdb to
ab9e5f1
Compare
Chunks created before and after a column was dropped have different
physical column layouts. Merging such chunks copied rows by column
position, which crashed or corrupted data. Rows are now converted by
column name when the layouts differ.
Fixes #10665
Disable-check: loader-change