Prevent client profiling maintenance from profiling itself
This commit is contained in:
parent
8632b283ef
commit
971d883db7
|
|
@ -616,13 +616,19 @@ struct TrInfoChunk {
|
|||
static const Key CLIENT_LATENCY_INFO_PREFIX = "client_latency/"_sr;
|
||||
static const Key CLIENT_LATENCY_INFO_CTR_PREFIX = "client_latency_counter/"_sr;
|
||||
|
||||
static void resetClientStatusTransaction(Transaction* tr) {
|
||||
tr->reset();
|
||||
// Profiling maintenance must not generate more records for itself to persist.
|
||||
tr->trState->trLogInfo.clear();
|
||||
}
|
||||
|
||||
static Future<Void> transactionInfoCommitActor(Transaction* tr, std::vector<TrInfoChunk>* chunks) {
|
||||
const Key clientLatencyAtomicCtr = CLIENT_LATENCY_INFO_CTR_PREFIX.withPrefix(fdbClientInfoPrefixRange.begin);
|
||||
int retryCount = 0;
|
||||
while (true) {
|
||||
Error err;
|
||||
try {
|
||||
tr->reset();
|
||||
resetClientStatusTransaction(tr);
|
||||
tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
|
||||
tr->setOption(FDBTransactionOptions::LOCK_AWARE);
|
||||
[[maybe_unused]] Future<Standalone<StringRef>> vstamp = tr->getVersionstamp();
|
||||
|
|
@ -656,7 +662,7 @@ static Future<Void> delExcessClntTxnEntriesActor(Transaction* tr, int64_t client
|
|||
while (true) {
|
||||
Error err;
|
||||
try {
|
||||
tr->reset();
|
||||
resetClientStatusTransaction(tr);
|
||||
tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
|
||||
tr->setOption(FDBTransactionOptions::LOCK_AWARE);
|
||||
Optional<Value> ctrValue = co_await tr->get(KeyRef(clientLatencyAtomicCtr), Snapshot::True);
|
||||
|
|
|
|||
Loading…
Reference in New Issue