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

WT-12907: give txn read timestamp‘s Abnormal cause #10531

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

y123456yz
Copy link
Contributor

@y123456yz y123456yz commented Apr 29, 2024

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));
}

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: bbb");
    error_check(cursor->insert(cursor));
    testutil_check(session->timestamp_transaction(session, "commit_timestamp=5"));
    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

Copy link

Hi @y123456yz, thank you for your submission!
Please make sure to sign our Contributor Agreement (if you haven't already) and provide us with editor permissions on your branch. Instructions on how do that can be found here.

@y123456yz
Copy link
Contributor Author

WT-12907

@y123456yz y123456yz changed the title Give read timestamp‘s Abnormal cause WT-12907: give read timestamp‘s Abnormal cause Apr 29, 2024
@y123456yz y123456yz changed the title WT-12907: give read timestamp‘s Abnormal cause WT-12907: give txn read timestamp‘s Abnormal cause Apr 29, 2024
@y123456yz
Copy link
Contributor Author

y123456yz commented May 2, 2024

Since we mask the exception log in the real online production environment, I add a txn_set_read_timestamp_more_than_oldest_timestamp statistic so that we can obtain the exception statistics.
mongo server version 4.2 In a real transaction usage environment, many clusters have this exception logs, If the log is blocked frequently, we cannot get this exception information,It is therefore recommended to add this statistic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant