MCPcopy Create free account
hub / github.com/apple/foundationdb / upToDateImpl

Method upToDateImpl

fdbclient/ClusterConnectionKey.actor.cpp:77–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77ACTOR Future<bool> ClusterConnectionKey::upToDateImpl(Reference<ClusterConnectionKey> self,
78 ClusterConnectionString* connectionString) {
79 try {
80 // the cluster file hasn't been created yet so there's nothing to check
81 if (self->needsToBePersisted())
82 return true;
83
84 Reference<ClusterConnectionKey> temp =
85 wait(ClusterConnectionKey::loadClusterConnectionKey(self->db, self->connectionStringKey));
86 *connectionString = temp->getConnectionString();
87 return connectionString->toString() == self->cs.toString();
88 } catch (Error& e) {
89 TraceEvent(SevWarnAlways, "ClusterKeyError").error(e).detail("Key", self->connectionStringKey);
90 return false; // Swallow the error and report that the file is out of date
91 }
92}
93
94// Checks whether the connection string in the database matches the connection string stored in memory. The cluster
95// string stored in the database is returned via the reference parameter connectionString.

Callers

nothing calls this directly

Calls 5

TraceEventClass · 0.85
needsToBePersistedMethod · 0.80
detailMethod · 0.80
toStringMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected