fix: do not block fdbcli from starting if DataDistributionStatus is not available
This commit is contained in:
parent
d8ab48ce7f
commit
2a436d5f6f
|
@ -1341,13 +1341,17 @@ ACTOR Future<vector<AddressExclusion>> getExcludedServers( Database cx ) {
|
||||||
|
|
||||||
ACTOR Future<Void> checkDataDistributionStatus(Database cx, bool printWarningOnly) {
|
ACTOR Future<Void> checkDataDistributionStatus(Database cx, bool printWarningOnly) {
|
||||||
state Transaction tr(cx);
|
state Transaction tr(cx);
|
||||||
|
state Future<Void> timeoutDelay = printWarningOnly ? delay(2.0) : Never();
|
||||||
loop {
|
loop {
|
||||||
try {
|
try {
|
||||||
tr.setOption(FDBTransactionOptions::LOCK_AWARE);
|
tr.setOption(FDBTransactionOptions::LOCK_AWARE);
|
||||||
state Future<Optional<Value>> overallSwitchF = tr.get(dataDistributionModeKey);
|
state Future<Optional<Value>> overallSwitchF = tr.get(dataDistributionModeKey);
|
||||||
state Future<Optional<Value>> healthyZoneValueF = tr.get(healthyZoneKey);
|
state Future<Optional<Value>> healthyZoneValueF = tr.get(healthyZoneKey);
|
||||||
state Future<Optional<Value>> rebalanceDDIgnoreValueF = tr.get(rebalanceDDIgnoreKey);
|
state Future<Optional<Value>> rebalanceDDIgnoreValueF = tr.get(rebalanceDDIgnoreKey);
|
||||||
wait(success(overallSwitchF) && success(healthyZoneValueF) && success(rebalanceDDIgnoreValueF));
|
wait(timeoutDelay || (success(overallSwitchF) && success(healthyZoneValueF) && success(rebalanceDDIgnoreValueF)));
|
||||||
|
if(timeoutDelay.isReady()) {
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
if (overallSwitchF.get().present()) {
|
if (overallSwitchF.get().present()) {
|
||||||
BinaryReader rd(overallSwitchF.get().get(), Unversioned());
|
BinaryReader rd(overallSwitchF.get().get(), Unversioned());
|
||||||
int currentMode;
|
int currentMode;
|
||||||
|
|
Loading…
Reference in New Issue