Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#17957] docdb: Fix TSAN race condition in YBTransaction::Impl::Prepa…
…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
- Loading branch information