@@ -136,6 +136,7 @@ TExecutor::TExecutor(
136136 , CounterEventsInFlight(new TEvTabletCounters::TInFlightCookie)
137137 , Stats(new TExecutorStatsImpl())
138138 , LogFlushDelayOverrideUsec(-1 , -1 , 60 *1000 *1000 )
139+ , MaxCommitRedoMB(256 , 1 , 4096 )
139140{}
140141
141142TExecutor::~TExecutor () {
@@ -159,6 +160,7 @@ void TExecutor::Registered(TActorSystem *sys, const TActorId&)
159160 Memory = new TMemory (Logger.Get (), this , Emitter, Sprintf (" at tablet %" PRIu64, Owner->TabletID ()));
160161 TString myTabletType = TTabletTypes::TypeToStr (Owner->TabletType ());
161162 AppData ()->Icb ->RegisterSharedControl (LogFlushDelayOverrideUsec, myTabletType + " _LogFlushDelayOverrideUsec" );
163+ AppData ()->Icb ->RegisterSharedControl (MaxCommitRedoMB, " TabletControls.MaxCommitRedoMB" );
162164
163165 // instantiate alert counters so even never reported alerts are created
164166 GetServiceCounters (AppData ()->Counters , " tablets" )->GetCounter (" alerts_pending_nodata" , true );
@@ -1724,12 +1726,17 @@ void TExecutor::ExecuteTransaction(TAutoPtr<TSeat> seat, const TActorContext &ct
17241726 }
17251727
17261728 bool failed = false ;
1727- TString failureReason;
1728- if (done && (failed = !Database->ValidateCommit (failureReason))) {
1729- if (auto logl = Logger->Log (ELnLev::Crit)) {
1730- logl
1731- << NFmt::Do (*this ) << " " << NFmt::Do (*seat)
1732- << " fatal commit failure: " << failureReason;
1729+ if (done) {
1730+ ui64 commitRedoBytes = Database->GetCommitRedoBytes ();
1731+ ui64 maxCommitRedoBytes = ui64 (MaxCommitRedoMB) << 20 ; // MB to bytes
1732+ if (commitRedoBytes > maxCommitRedoBytes) {
1733+ if (auto logl = Logger->Log (ELnLev::Crit)) {
1734+ logl
1735+ << NFmt::Do (*this ) << " " << NFmt::Do (*seat)
1736+ << " fatal commit failure: Redo commit of " << commitRedoBytes
1737+ << " bytes is more than the allowed limit" ;
1738+ }
1739+ failed = true ;
17331740 }
17341741 }
17351742
0 commit comments