Fix unstable tests reindextable_while_reindex_idx #156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes: #26
Change logs
Three unstable tests matching reindex/reindextable_while_reindex_idx_*_part_btree are fixed. They failed in the same way thus could be fixed in the same manner.
These tests actually assumes when txn1 commits, its lock is acquired by txn3, and txn2 is blocked by it. Normally this is the case, but when the system load is high (e.g., when parallel is enabled, or other processes stress the system), it could be the case that the scheduler pass the access exclusive lock acquired by txn1 to txn2 (not txn3) in L22-L23, invalidate the assumption, causing the test to fail. Here I workaround this by instead of relying on the only one expected file which cannot checks two behaviour, SQL statement is used to directly check the correctness of one column.
This problem is also found in the upstream, mainline GPDB.
Note that this is a initial fix of one out of three total problematic cases. I'll fixed others once this passed review.