summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnaury <[email protected]>2023-10-18 20:04:41 +0300
committersnaury <[email protected]>2023-10-18 21:25:32 +0300
commit1ceea028000ae913d608587be6bd1e7ace690c54 (patch)
treef3f03e47256ed3d3be0cde5e8af032b0664b8a0c
parent0d1d00f64e1b2b8ed7cb57ae24fda0d8a979193e (diff)
Fix counter underflow in outgoing snapshot requests KIKIMR-19733
-rw-r--r--ydb/core/tx/long_tx_service/acquire_snapshot_impl.cpp5
-rw-r--r--ydb/core/tx/long_tx_service/long_tx_service_impl.cpp5
2 files changed, 5 insertions, 5 deletions
diff --git a/ydb/core/tx/long_tx_service/acquire_snapshot_impl.cpp b/ydb/core/tx/long_tx_service/acquire_snapshot_impl.cpp
index b8d079323b9..b98c33c7f51 100644
--- a/ydb/core/tx/long_tx_service/acquire_snapshot_impl.cpp
+++ b/ydb/core/tx/long_tx_service/acquire_snapshot_impl.cpp
@@ -205,6 +205,11 @@ namespace NLongTxService {
req.BeginTxRequests.swap(state.PendingBeginTxRequests);
Register(new TAcquireSnapshotActor(SelfId(), reqId, databaseName));
state.ActiveRequests.insert(reqId);
+
+ if (Settings.Counters) {
+ Settings.Counters->AcquireReadSnapshotOutRequests->Inc();
+ Settings.Counters->AcquireReadSnapshotOutInFlight->Inc();
+ }
}
} // namespace NLongTxService
diff --git a/ydb/core/tx/long_tx_service/long_tx_service_impl.cpp b/ydb/core/tx/long_tx_service/long_tx_service_impl.cpp
index 8d56e00d04a..9ed13192b97 100644
--- a/ydb/core/tx/long_tx_service/long_tx_service_impl.cpp
+++ b/ydb/core/tx/long_tx_service/long_tx_service_impl.cpp
@@ -390,11 +390,6 @@ void TLongTxServiceActor::Handle(TEvPrivate::TEvAcquireSnapshotFlush::TPtr& ev)
Y_ABORT_UNLESS(state.PendingUserRequests || state.PendingBeginTxRequests);
state.FlushPending = false;
- if (Settings.Counters) {
- Settings.Counters->AcquireReadSnapshotOutRequests->Inc();
- Settings.Counters->AcquireReadSnapshotOutInFlight->Inc();
- }
-
StartAcquireSnapshotActor(msg->DatabaseName, state);
}