|
31 | 31 | #include <ydb/core/base/hive.h> |
32 | 32 | #include <ydb/core/base/tablet_pipecache.h> |
33 | 33 | #include <ydb/core/control/lib/immediate_control_board_impl.h> |
| 34 | +#include <ydb/core/protos/memory_controller_config.pb.h> |
34 | 35 | #include <ydb/core/scheme/scheme_type_registry.h> |
35 | 36 | #include <ydb/core/tablet/tablet_counters_aggregator.h> |
36 | 37 | #include <ydb/library/actors/core/hfunc.h> |
|
45 | 46 | #include <util/generic/xrange.h> |
46 | 47 | #include <util/generic/ymath.h> |
47 | 48 |
|
| 49 | + |
48 | 50 | namespace NKikimr { |
49 | 51 | namespace NTabletFlatExecutor { |
50 | 52 |
|
51 | | -static constexpr ui64 MaxTxInFly = 10000; |
52 | 53 |
|
53 | 54 | LWTRACE_USING(TABLET_FLAT_PROVIDER) |
54 | 55 |
|
@@ -137,10 +138,10 @@ TExecutor::TExecutor( |
137 | 138 | , Stats(new TExecutorStatsImpl()) |
138 | 139 | , LogFlushDelayOverrideUsec(-1, -1, 60*1000*1000) |
139 | 140 | , MaxCommitRedoMB(256, 1, 4096) |
| 141 | + , MaxTxInFly(10000, 0, 1000000) |
140 | 142 | {} |
141 | 143 |
|
142 | 144 | TExecutor::~TExecutor() { |
143 | | - |
144 | 145 | } |
145 | 146 |
|
146 | 147 | bool TExecutor::OnUnhandledException(const std::exception& e) { |
@@ -180,6 +181,7 @@ void TExecutor::Registered(TActorSystem *sys, const TActorId&) |
180 | 181 | TString myTabletType = TTabletTypes::TypeToStr(Owner->TabletType()); |
181 | 182 | AppData()->Icb->RegisterSharedControl(LogFlushDelayOverrideUsec, myTabletType + "_LogFlushDelayOverrideUsec"); |
182 | 183 | AppData()->Icb->RegisterSharedControl(MaxCommitRedoMB, "TabletControls.MaxCommitRedoMB"); |
| 184 | + AppData()->Icb->RegisterSharedControl(MaxTxInFly, "TabletControls.MaxTxInFly"); |
183 | 185 |
|
184 | 186 | // instantiate alert counters so even never reported alerts are created |
185 | 187 | GetServiceCounters(AppData()->Counters, "tablets")->GetCounter("alerts_pending_nodata", true); |
@@ -4072,8 +4074,7 @@ void TExecutor::ForceSendCounters() { |
4072 | 4074 |
|
4073 | 4075 | float TExecutor::GetRejectProbability() const { |
4074 | 4076 | // Limit number of in-flight TXs |
4075 | | - // TODO: make configurable |
4076 | | - if (Stats->TxInFly > MaxTxInFly) { |
| 4077 | + if (Stats->TxInFly > ui64(MaxTxInFly)) { |
4077 | 4078 | HadRejectProbabilityByTxInFly = true; |
4078 | 4079 | return 1.0; |
4079 | 4080 | } |
@@ -4109,7 +4110,7 @@ float TExecutor::GetRejectProbability() const { |
4109 | 4110 | } |
4110 | 4111 |
|
4111 | 4112 | void TExecutor::MaybeRelaxRejectProbability() { |
4112 | | - if (HadRejectProbabilityByTxInFly && Stats->TxInFly <= MaxTxInFly || |
| 4113 | + if (HadRejectProbabilityByTxInFly && Stats->TxInFly <= ui64(MaxTxInFly) || |
4113 | 4114 | HadRejectProbabilityByOverload) |
4114 | 4115 | { |
4115 | 4116 | HadRejectProbabilityByTxInFly = false; |
|
0 commit comments