Do not automatically change a cluster file that does not match what you expect.
This commit is contained in:
parent
311d1ca87d
commit
cd085764f1
|
@ -33,8 +33,6 @@ ClientKnobs::ClientKnobs(bool randomize) {
|
|||
|
||||
init( TOO_MANY, 1000000 );
|
||||
|
||||
init( CLUSTER_FILE_REWRITE_DELAY, 30.0 );
|
||||
|
||||
init( SYSTEM_MONITOR_INTERVAL, 5.0 );
|
||||
|
||||
init( FAILURE_MAX_DELAY, 10.0 ); if( randomize && BUGGIFY ) FAILURE_MAX_DELAY = 5.0;
|
||||
|
|
|
@ -32,8 +32,6 @@ public:
|
|||
|
||||
int TOO_MANY; // FIXME: this should really be split up so we can control these more specifically
|
||||
|
||||
double CLUSTER_FILE_REWRITE_DELAY;
|
||||
|
||||
double SYSTEM_MONITOR_INTERVAL;
|
||||
|
||||
double FAILURE_MAX_DELAY;
|
||||
|
|
|
@ -480,8 +480,6 @@ DatabaseContext::DatabaseContext(
|
|||
ACTOR static Future<Void> monitorClientInfo( Reference<AsyncVar<Optional<ClusterInterface>>> clusterInterface, Standalone<StringRef> dbName,
|
||||
Reference<ClusterConnectionFile> ccf, Reference<AsyncVar<ClientDBInfo>> outInfo )
|
||||
{
|
||||
state double badClusterFileStartTime = 0;
|
||||
state bool unableToWriteClusterFile = false;
|
||||
try {
|
||||
loop {
|
||||
OpenDatabaseRequest req;
|
||||
|
@ -492,30 +490,13 @@ ACTOR static Future<Void> monitorClientInfo( Reference<AsyncVar<Optional<Cluster
|
|||
|
||||
ClusterConnectionString fileConnectionString;
|
||||
if (ccf && !ccf->fileContentsUpToDate(fileConnectionString)) {
|
||||
if(!ccf->canGetFilename()) {
|
||||
unableToWriteClusterFile = true;
|
||||
}
|
||||
else if(badClusterFileStartTime == 0) {
|
||||
badClusterFileStartTime = now();
|
||||
}
|
||||
else if(now()-badClusterFileStartTime > CLIENT_KNOBS->CLUSTER_FILE_REWRITE_DELAY) {
|
||||
req.issues = LiteralStringRef("unable_to_write_cluster_file");
|
||||
if(ccf->canGetFilename()) {
|
||||
TraceEvent(SevWarnAlways, "IncorrectClusterFileContents").detail("Filename", ccf->getFilename())
|
||||
.detail("ConnectionStringFromFile", fileConnectionString.toString())
|
||||
.detail("CurrentConnectionString", ccf->getConnectionString().toString());
|
||||
|
||||
if(!unableToWriteClusterFile) {
|
||||
unableToWriteClusterFile = !ccf->writeFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
badClusterFileStartTime = 0;
|
||||
unableToWriteClusterFile = false;
|
||||
}
|
||||
|
||||
if(unableToWriteClusterFile) {
|
||||
req.issues = LiteralStringRef("unable_to_write_cluster_file");
|
||||
}
|
||||
|
||||
choose {
|
||||
when( ClientDBInfo ni = wait( clusterInterface->get().present() ? brokenPromiseToNever( clusterInterface->get().get().openDatabase.getReply( req ) ) : Never() ) ) {
|
||||
|
|
|
@ -434,9 +434,6 @@ void endRole(UID id, std::string as, std::string reason, bool ok, Error e) {
|
|||
}
|
||||
|
||||
ACTOR Future<Void> monitorServerDBInfo( Reference<AsyncVar<Optional<ClusterControllerFullInterface>>> ccInterface, Reference<ClusterConnectionFile> connFile, LocalityData locality, Reference<AsyncVar<ServerDBInfo>> dbInfo ) {
|
||||
state double badClusterFileStartTime = 0;
|
||||
state bool unableToWriteClusterFile = false;
|
||||
|
||||
// Initially most of the serverDBInfo is not known, but we know our locality right away
|
||||
ServerDBInfo localInfo;
|
||||
localInfo.myLocality = locality;
|
||||
|
@ -448,30 +445,13 @@ ACTOR Future<Void> monitorServerDBInfo( Reference<AsyncVar<Optional<ClusterContr
|
|||
|
||||
ClusterConnectionString fileConnectionString;
|
||||
if (connFile && !connFile->fileContentsUpToDate(fileConnectionString)) {
|
||||
if(!connFile->canGetFilename()) {
|
||||
unableToWriteClusterFile = true;
|
||||
}
|
||||
else if(badClusterFileStartTime == 0) {
|
||||
badClusterFileStartTime = now();
|
||||
}
|
||||
else if(now()-badClusterFileStartTime > CLIENT_KNOBS->CLUSTER_FILE_REWRITE_DELAY) {
|
||||
req.issues = LiteralStringRef("unable_to_write_cluster_file");
|
||||
if(connFile->canGetFilename()) {
|
||||
TraceEvent(SevWarnAlways, "IncorrectClusterFileContents").detail("Filename", connFile->getFilename())
|
||||
.detail("ConnectionStringFromFile", fileConnectionString.toString())
|
||||
.detail("CurrentConnectionString", connFile->getConnectionString().toString());
|
||||
|
||||
if(!unableToWriteClusterFile) {
|
||||
unableToWriteClusterFile = !connFile->writeFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
badClusterFileStartTime = 0;
|
||||
unableToWriteClusterFile = false;
|
||||
}
|
||||
|
||||
if(unableToWriteClusterFile) {
|
||||
req.issues = LiteralStringRef("unable_to_write_cluster_file");
|
||||
}
|
||||
|
||||
auto peers = FlowTransport::transport().getIncompatiblePeers();
|
||||
for(auto it = peers->begin(); it != peers->end();) {
|
||||
|
|
Loading…
Reference in New Issue