forward back new coordinator
This commit is contained in:
parent
fcfb78162c
commit
fc65154b5d
|
@ -252,16 +252,16 @@ struct CheckDescriptorMutableReply {
|
|||
|
||||
// Allows client to check if allowed to change the cluster descriptor.
|
||||
struct CheckDescriptorMutable {
|
||||
constexpr static FileIdentifier file_identifier = 214729;
|
||||
Key key;
|
||||
ReplyPromise<CheckDescriptorMutableReply> reply;
|
||||
explicit CheckDescriptorMutable(Key key) : key(key) {}
|
||||
CheckDescriptorMutable(){}
|
||||
constexpr static FileIdentifier file_identifier = 214729;
|
||||
Key key;
|
||||
ReplyPromise<CheckDescriptorMutableReply> reply;
|
||||
explicit CheckDescriptorMutable(Key key) : key(key) {}
|
||||
CheckDescriptorMutable(){}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, key, reply);
|
||||
}
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, key, reply);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -559,11 +559,16 @@ ACTOR Future<Void> leaderServer(LeaderElectionRegInterface interf, OnDemandStore
|
|||
state ActorCollection forwarders(false);
|
||||
|
||||
wait(LeaderRegisterCollection::init(®s));
|
||||
|
||||
|
||||
loop choose {
|
||||
when(CheckDescriptorMutable req = waitNext(interf.checkDescriptorMutable.getFuture())) {
|
||||
CheckDescriptorMutableReply rep(SERVER_KNOBS->ENABLE_CROSS_CLUSTER_SUPPORT ? true : false);
|
||||
req.reply.send(rep);
|
||||
Optional<LeaderInfo> forward = regs.getForward(req.key);
|
||||
if (forward.present()) {
|
||||
req.reply.send(CheckDescriptorMutableReply{false});
|
||||
} else {
|
||||
CheckDescriptorMutableReply rep(SERVER_KNOBS->ENABLE_CROSS_CLUSTER_SUPPORT ? true : false);
|
||||
req.reply.send(rep);
|
||||
}
|
||||
}
|
||||
when(OpenDatabaseCoordRequest req = waitNext(interf.openDatabase.getFuture())) {
|
||||
Optional<LeaderInfo> forward = regs.getForward(req.clusterKey);
|
||||
|
|
Loading…
Reference in New Issue