Skip to content

Commit ef0a20c

Browse files
Zhe WangZhe Wang
authored andcommitted
Add trace event for role recruitment by CC
1 parent 11f2da7 commit ef0a20c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fdbserver/ClusterController.actor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3580,10 +3580,12 @@ void clusterRecruitStorage(ClusterControllerData* self, RecruitStorageRequest re
35803580
ACTOR Future<Void> clusterRecruitFromConfiguration(ClusterControllerData* self, RecruitFromConfigurationRequest req) {
35813581
// At the moment this doesn't really need to be an actor (it always completes immediately)
35823582
TEST(true); // ClusterController RecruitTLogsRequest
3583+
state double startTime = now();
35833584
loop {
35843585
try {
35853586
auto rep = self->findWorkersForConfiguration(req);
35863587
req.reply.send(rep);
3588+
TraceEvent("RecruitFromConfigurationDone", self->id).detail("WaitTime", now() - startTime);
35873589
return Void();
35883590
} catch (Error& e) {
35893591
if (e.code() == error_code_no_more_servers && self->goodRecruitmentTime.isReady()) {
@@ -3592,6 +3594,7 @@ ACTOR Future<Void> clusterRecruitFromConfiguration(ClusterControllerData* self,
35923594
return Void();
35933595
} else if (e.code() == error_code_operation_failed || e.code() == error_code_no_more_servers) {
35943596
// recruitment not good enough, try again
3597+
TraceEvent("RecruitFromConfigurationRetry", self->id).error(e);
35953598
} else {
35963599
TraceEvent(SevError, "RecruitFromConfigurationError", self->id).error(e);
35973600
throw; // goodbye, cluster controller
@@ -3605,10 +3608,12 @@ ACTOR Future<Void> clusterRecruitRemoteFromConfiguration(ClusterControllerData*
36053608
RecruitRemoteFromConfigurationRequest req) {
36063609
// At the moment this doesn't really need to be an actor (it always completes immediately)
36073610
TEST(true); // ClusterController RecruitTLogsRequest Remote
3611+
state double startTime = now();
36083612
loop {
36093613
try {
36103614
RecruitRemoteFromConfigurationReply rep = self->findRemoteWorkersForConfiguration(req);
36113615
req.reply.send(rep);
3616+
TraceEvent("RecruitRemoteFromConfigurationDone", self->id).detail("WaitTime", now() - startTime);
36123617
return Void();
36133618
} catch (Error& e) {
36143619
if (e.code() == error_code_no_more_servers && self->goodRemoteRecruitmentTime.isReady()) {
@@ -3617,6 +3622,7 @@ ACTOR Future<Void> clusterRecruitRemoteFromConfiguration(ClusterControllerData*
36173622
return Void();
36183623
} else if (e.code() == error_code_operation_failed || e.code() == error_code_no_more_servers) {
36193624
// recruitment not good enough, try again
3625+
TraceEvent("RecruitRemoteFromConfigurationRetry", self->id).error(e);
36203626
} else {
36213627
TraceEvent(SevError, "RecruitRemoteFromConfigurationError", self->id).error(e);
36223628
throw; // goodbye, cluster controller

0 commit comments

Comments
 (0)