A follow-on fix for config key usage

And some trace event cleanups.
This commit is contained in:
Jingyu Zhou 2019-01-24 21:19:11 -08:00 committed by Jingyu Zhou
parent be5c962bb7
commit 6a655143e8
4 changed files with 11 additions and 8 deletions

View File

@ -702,6 +702,7 @@ ConfigureAutoResult parseConfig( StatusObject const& status ) {
ACTOR Future<ConfigurationResult::Type> autoConfig( Database cx, ConfigureAutoResult conf ) {
state Transaction tr(cx);
state std::string versionKey = g_random->randomUniqueID().toString();
if(!conf.address_class.size())
return ConfigurationResult::INCOMPLETE_CONFIGURATION; //FIXME: correct return type
@ -751,6 +752,9 @@ ACTOR Future<ConfigurationResult::Type> autoConfig( Database cx, ConfigureAutoRe
tr.set(kv.first, kv.second);
}
tr.addReadConflictRange( singleKeyRange(configVersionKey) );
tr.set( configVersionKey, versionKey );
wait( tr.commit() );
return ConfigurationResult::SUCCESS;
} catch( Error &e ) {

View File

@ -2274,9 +2274,9 @@ ACTOR Future<Void> waitDDRejoinOrStartDD( ClusterControllerData *self, ClusterCo
// Wait on failures and restart it.
loop choose {
when ( DataDistributorInterface distributorInterf = wait( newDistributor ) ) {
TraceEvent ev("ClusterController", self->id);
const UID myDdId = self->db.serverInfo->get().distributor.id();
ev.detail("NewDataDistributorID", distributorInterf.id()).detail("Valid", distributorInterf.isValid());
TraceEvent("ClusterController", self->id)
.detail("DataDistributorID", distributorInterf.id())
.detail("Valid", distributorInterf.isValid());
self->db.setDistributor( distributorInterf );
distributorFailed = waitFailureClient( distributorInterf.waitFailure, SERVER_KNOBS->DD_FAILURE_TIME );
newDistributor = Never();
@ -2284,13 +2284,12 @@ ACTOR Future<Void> waitDDRejoinOrStartDD( ClusterControllerData *self, ClusterCo
when ( wait( distributorFailed ) ) {
distributorFailed = Never();
TraceEvent("ClusterController", self->id)
.detail("DataDistributorFailed", self->db.serverInfo->get().distributor.id())
.detail("Endpoint", self->db.serverInfo->get().distributor.getRateInfo.getEndpoint().token);
.detail("DataDistributorDied", self->db.serverInfo->get().distributor.id());
self->db.setDistributor( DataDistributorInterface() );
newDistributor = startDataDistributor( self );
}
when ( DataDistributorRejoinRequest req = waitNext( clusterInterface->dataDistributorRejoin.getFuture() ) ) {
TraceEvent("ClusterController", self->id).detail("DataDistributorRejoinIgnored", req.dataDistributor.id());
// TraceEvent("ClusterController", self->id).detail("DataDistributorRejoinIgnored", req.dataDistributor.id());
req.reply.send( Void() );
}
}

View File

@ -3437,7 +3437,7 @@ ACTOR Future<Void> dataDistributor(DataDistributorInterface di, Reference<AsyncV
TraceEvent("DataDistributorError", di.id()).error(err);
throw err;
}
TraceEvent("DataDistributorTerminated", di.id()).error(err);
TraceEvent("DataDistributorDied", di.id()).error(err);
}
return Void();

View File

@ -1154,7 +1154,7 @@ ACTOR Future<Void> configurationMonitor( Reference<MasterData> self ) {
self->registrationTrigger.trigger();
}
state Future<Void> watchFuture = tr.watch(excludedServersVersionKey);
state Future<Void> watchFuture = tr.watch(configVersionKey);
wait(tr.commit());
wait(watchFuture);
break;