Fix a performance bug in Resolver

The erased bytes from recent state transactions was accidently set to 0 and
cause anyPopped to be always false. Thus, when totalStateBytes will never
decrease and can cause high latency between "Resolver.resolveBatch.Before" and
"Resolver.resolveBatch.AfterQueueSizeCheck", in hundreds of milliseconds. This
will cause high server side commit latency.
This commit is contained in:
Jingyu Zhou 2022-07-07 21:55:52 -07:00
parent 1e8feb9cb8
commit 4103b16793
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ ACTOR Future<Void> resolveBatch(Reference<Resolver> self, ResolveTransactionBatc
TEST(true); // Deleting old state transactions
int64_t erasedBytes = self->recentStateTransactionsInfo.eraseUpTo(oldestProxyVersion);
self->debugMinRecentStateVersion = oldestProxyVersion + 1;
anyPopped = erasedBytes = 0;
anyPopped = erasedBytes > 0;
stateBytes -= erasedBytes;
}