ADBDEV-7370: Add comment explaining gp_replica_check error #1525
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.
Add comment explaining gp_replica_check error
frozen_insert_crash isolation test leaves an AO table tab_fi without cleaning
it up. When writing AO tables, the data is first written to disk and only then
added to WALs. This is acceptable because the visible state of the AO table is
determined by EOF field, which is stored in a regular heap table, and so is
transactional. However, this means that if a crash happens after data is
written to disk, but before writing to WAL, primary's and mirror's segment
files will be different, with primary's file containing the new tuple and
mirror's file missing it.
If gp_replica_check is run after this test, it detects the difference and
signals it as an error. However, this mismatch is actually acceptable, since
EOF change was not committed due to the crash, and so the visible state is
actually identical. If new tuples are added after the crash, they overwrite
the data on primary and the files become identical again.
Unfortunately, making gp_replica_check properly support AO tables is
complicated, because that would require creating new interfaces. EOF is stored
in a different (heap) table, and has different values of each segment file,
and so isn't accessible through existing ones. Fixing gp_replica_check is not
a priority right now, so this patch adds a comment to the test as an
explanation for why this test may cause gp_replica_check errors.