WT-12907: give txn read timestamp‘s Abnormal cause #10531
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.
Background: in HAVE_DIAGNOSTIC mode, the following code is abnormal, but No root cause was given:
testutil_check(conn->set_timestamp(conn, "oldest_timestamp=10, stable_timestamp=10"));
for (i = 0; i < kv_num; i++) {
error_check(session->begin_transaction(session, NULL));
cursor->set_key(cursor, i); /* Insert a record. */
cursor->set_value(cursor, "value: aaa");
error_check(cursor->insert(cursor));
testutil_check(session->timestamp_transaction(session, "commit_timestamp=20"));
error_check(session->commit_transaction(session, NULL));
}
The log is as follows:
[1714395388:975693][35391:0x7f2b937b8800], WT_SESSION.__session_begin_transaction: [WT_VERB_API][DEBUG_1]: CALL: WT_SESSION:__session_begin_transaction
ex_access: FAILED: access_txn23_test/316: session->begin_transaction(session, "read_timestamp=5"): Invalid argument
ex_access: process aborting
WiredTiger Error: __wt_abort, 28: aborting WiredTiger library
Aborted (core dumped)
after this PR, the log info is:
[1714395512:946863][36783:0x7fa6955e1800], WT_SESSION.__session_begin_transaction: [WT_VERB_API][DEBUG_1]: CALL: WT_SESSION:__session_begin_transaction
[1714395512:946892][36783:0x7fa6955e1800], WT_SESSION.__session_begin_transaction: [WT_VERB_TIMESTAMP][NOTICE]: read timestamp (0, 5) less than the oldest timestamp (0, 16)
ex_access: FAILED: access_txn23_test/316: session->begin_transaction(session, "read_timestamp=5"): Invalid argument
ex_access: process aborting
WiredTiger Error: _wt