Fix DCC tester (#11995)

This commit is contained in:
Zhe Wang 2025-03-05 13:41:08 -08:00 committed by GitHub
parent 8142ebd029
commit 2e47e97613
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 10 deletions

View File

@ -57,6 +57,7 @@
#include "fdbserver/MoveKeys.actor.h"
#include "flow/Platform.h"
#include "flow/Trace.h"
#include "flow/actorcompiler.h" // This must be the last #include.
WorkloadContext::WorkloadContext() {}
@ -964,20 +965,26 @@ ACTOR Future<Void> testerServerCore(TesterInterface interf,
} else if (work.title == "ConsistencyCheckUrgent") {
// The workload is a consistency checker urgent workload
if (work.sharedRandomNumber == consistencyCheckerUrgentTester.first) {
TraceEvent(SevInfo, "ConsistencyCheckUrgent_TesterDuplicatedRequest", interf.id())
// A single req can be sent for multiple times. In this case, the sharedRandomNumber is same as
// the existing one. For this scenario, we reply an error. This case should be rare.
TraceEvent(SevWarn, "ConsistencyCheckUrgent_TesterDuplicatedRequest", interf.id())
.detail("ConsistencyCheckerId", work.sharedRandomNumber)
.detail("ClientId", work.clientId)
.detail("ClientCount", work.clientCount);
work.reply.sendError(consistency_check_urgent_duplicate_request());
} else if (consistencyCheckerUrgentTester.second.isValid() &&
!consistencyCheckerUrgentTester.second.isReady()) {
TraceEvent(SevWarnAlways, "ConsistencyCheckUrgent_TesterWorkloadConflict", interf.id())
.detail("ExistingConsistencyCheckerId", consistencyCheckerUrgentTester.first)
.detail("ArrivingConsistencyCheckerId", work.sharedRandomNumber)
.detail("ClientId", work.clientId)
.detail("ClientCount", work.clientCount);
work.reply.sendError(consistency_check_urgent_conflicting_request());
} else {
// When the req.sharedRandomNumber is different from the existing one, the cluster has muiltiple
// consistencycheckurgent roles at the same time. Evenutally, the cluster will have only one
// consistencycheckurgent role in a stable state. So, in this case, we simply let the new request to
// overwrite the old request. After the work is destroyed, the broken_promise will be replied.
if (consistencyCheckerUrgentTester.second.isValid() &&
!consistencyCheckerUrgentTester.second.isReady()) {
TraceEvent(SevWarnAlways, "ConsistencyCheckUrgent_TesterWorkloadConflict", interf.id())
.detail("ExistingConsistencyCheckerId", consistencyCheckerUrgentTester.first)
.detail("ArrivingConsistencyCheckerId", work.sharedRandomNumber)
.detail("ClientId", work.clientId)
.detail("ClientCount", work.clientCount);
}
consistencyCheckerUrgentTester = std::make_pair(
work.sharedRandomNumber, testerServerConsistencyCheckerUrgentWorkload(work, ccr, dbInfo));
TraceEvent(SevInfo, "ConsistencyCheckUrgent_TesterWorkloadInitialized", interf.id())

View File

@ -109,7 +109,6 @@ ERROR( dd_config_changed, 1084, "DataDistribution configuration changed." )
ERROR( consistency_check_urgent_task_failed, 1085, "Consistency check urgent task is failed")
ERROR( data_move_conflict, 1086, "Data move conflict in SS")
ERROR( consistency_check_urgent_duplicate_request, 1087, "Consistency check urgent got a duplicate request")
ERROR( consistency_check_urgent_conflicting_request, 1088, "Consistency check urgent can process 1 workload at a time")
ERROR( broken_promise, 1100, "Broken promise" )
ERROR( operation_cancelled, 1101, "Asynchronous operation cancelled" )