You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[#26666] docdb: Skip tracking readonly transactions in recently_applied_ map
Summary:
We currently track all recently applied transactions in the recently_applied_ map in
transaction participant in order to calculate the min_replay_txn_start_ht used to filter
transactions during transaction loading in tablet bootstrap.
It is posible to have a table where the only transactions performed on it are readonly, i.e.
no WRITE_OPs with write pairs. In this case, since we do not replicate any write pairs, the
retryable requests max_replicated_op_id is never updated. The op id we use to filter the
recently_applied_ map with to clean it up is at most max_replicated_op_id, so we end up never
removing entries from the map, and the size of this map grows indefinitely.
This diff changes the behavior to never add transactions that have no batches with any write pairs
to recently_applied_, to avoid this issue.
Memory consumed by the recently_applied_ map was also added to mem tracker.
Jira: DB-16044
Test Plan:
Added tests:
`./yb_build.sh --cxx-test pgwrapper_pg_mini-test --gtest_filter PgMiniTestSingleNode.TestAppliedTransactionsStateReadOnly`
`./yb_build.sh --cxx-test pgwrapper_pg_mini-test --gtest_filter PgMiniTest.TestAppliedTransactionsStateInFlight`
Reviewers: sergei, bkolagani
Reviewed By: sergei, bkolagani
Subscribers: bkolagani, rthallam, ybase, yql
Differential Revision: https://phorge.dev.yugabyte.com/D43077
0 commit comments