-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DocDB] TSAN race condition in YBTransaction::Impl::PrepareHeartbeatRPC #17957
Comments
|
The start_ field is set in CompleteInit but it is also used when preparing the heartbeat RPC. When the transaction is taken from a pool, it is already periodically sending heartbeat RPCs to the status tablet. |
It would be good to add proper GUARDED_BY thread safety analysis annotation to this field. |
Potentially related issue in https://detective-gcp.dev.yugabyte.com/stability/test?branch=master&build_type=all&class=SealTxnTest&fail_tag=asan_heap_use_after_free&name=Update&platform=linux
I wonder if this is something specific to this test (as we don't use the txn sealing feature), or if it's just a generic issue. |
@bmatican I think ASAN error you posted is probably unrelated, because it is in TransactionCoordinator, while the stack trace in this issue is in YBTransaction. |
Ok, my bad Mikhail. I took it out into a standalone GH issue: #17983 |
…reHeartbeatRPC Summary: This diff fixes a race condition introduced in 320cffb/D25351 between setting the `start_` variable (time transaction was taken from the transaction pool) and reading the `start_` variable during heartbeat in order to send it to the transaction coordinator for `GetOldTransactions` RPC support by making `start_` atomic. The value is only used for `GetOldTransactions`, was already not sent when `start_` has not been set yet, and transaction coordinator code already expects cases where it has not been set, so aside from the possibility of a torn read, this is a race condition with fairly isolated impact. Jira: DB-7026 Test Plan: `ybd tsan --cxx-test pg_single_tserver-test --gtest_filter PgSingleTServerTest.ScanWithPackedRow` Reviewers: sergei Reviewed By: sergei Subscribers: rsami, ybase, mbautin Differential Revision: https://phorge.dev.yugabyte.com/D26741
Jira Link: DB-7026
Description
https://gist.githubusercontent.com/mbautin/55aecd59151b584cd1c7073d2ceffe84/raw
./yb_build.sh tsan --cxx-test pg_single_tserver-test --gtest_filter PgSingleTServerTest.ScanWithPackedRow
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: