Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address flakiness in commit LSN map test #4739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions tests/commit_lsn_map.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,6 @@ verify_correct_utxnids_in_map() {
test_recover_to_lsn() {
trap 'error $LINENO' ERR

local host
host=$(cdb2sql --tabs ${CDB2_OPTIONS} $dbnm default "select comdb2_host()")
readonly host

# Given

# Run some initial traffic
Expand All @@ -409,7 +405,7 @@ test_recover_to_lsn() {
done

local utxnids_to_recover
utxnids_to_recover=$(cdb2sql --tabs ${CDB2_OPTIONS} --host $host $dbnm \
utxnids_to_recover=$(cdb2sql --tabs ${CDB2_OPTIONS} --host $master $dbnm \
'select distinct utxnid from comdb2_transaction_commit order by utxnid' \
| sed 's/ /\n/g')
readonly utxnids_to_recover
Expand All @@ -432,7 +428,7 @@ test_recover_to_lsn() {
pushlogs 3

local utxnids_to_be_deleted_during_recovery
utxnids_to_be_deleted_during_recovery=$(cdb2sql --tabs ${CDB2_OPTIONS} --host $host $dbnm \
utxnids_to_be_deleted_during_recovery=$(cdb2sql --tabs ${CDB2_OPTIONS} --host $master $dbnm \
"select distinct utxnid from comdb2_transaction_commit where commitlsnfile > $recovery_lsn_file or commitlsnfile = $recovery_lsn_file and commitlsnoffset > $recovery_lsn_offset order by utxnid" \
| sed 's/ /\n/g')
readonly utxnids_to_be_deleted_during_recovery
Expand All @@ -441,13 +437,12 @@ test_recover_to_lsn() {

cdb2sql ${CDB2_OPTIONS} --host $master $dbnm \
"exec procedure sys.cmd.truncate_log(\"{$recovery_lsn}\")"
sleep 5 # Wait for cluster to run recovery

# Then

verify_txmap_has_expected_min_max_files 1 1 "$host"
verify_cached_modsnap_start_lsn_after_recovery "$host"
verify_correct_utxnids_in_map "$utxnids_to_recover" "$utxnids_to_be_deleted_during_recovery" "$host"
verify_txmap_has_expected_min_max_files 1 1 "$master"
verify_cached_modsnap_start_lsn_after_recovery "$master"
verify_correct_utxnids_in_map "$utxnids_to_recover" "$utxnids_to_be_deleted_during_recovery" "$master"
}

if [ "$TESTCASE" == "commit_lsn_map_delete_generated" ];
Expand Down