remove forwarding

This commit is contained in:
Dan Lambright 2021-05-28 11:09:41 -04:00
parent 10289ef8f1
commit cc3175fc50
2 changed files with 3 additions and 9 deletions

View File

@ -254,13 +254,12 @@ struct CheckDescriptorMutableReply {
// Allows client to check if allowed to change the cluster descriptor. // Allows client to check if allowed to change the cluster descriptor.
struct CheckDescriptorMutableRequest { struct CheckDescriptorMutableRequest {
constexpr static FileIdentifier file_identifier = 214729; constexpr static FileIdentifier file_identifier = 214729;
Key key;
ReplyPromise<CheckDescriptorMutableReply> reply; ReplyPromise<CheckDescriptorMutableReply> reply;
CheckDescriptorMutableRequest() {} CheckDescriptorMutableRequest() {}
template <class Ar> template <class Ar>
void serialize(Ar& ar) { void serialize(Ar& ar) {
serializer(ar, key, reply); serializer(ar, reply);
} }
}; };

View File

@ -564,15 +564,10 @@ ACTOR Future<Void> leaderServer(LeaderElectionRegInterface interf,
loop choose { loop choose {
when(CheckDescriptorMutableRequest req = waitNext(interf.checkDescriptorMutable.getFuture())) { when(CheckDescriptorMutableRequest req = waitNext(interf.checkDescriptorMutable.getFuture())) {
Optional<LeaderInfo> forward = regs.getForward(req.key);
// Note the response returns the value of a knob enforced by checking only one coordinator. It is not // Note the response returns the value of a knob enforced by checking only one coordinator. It is not
// quorum based. // quorum based.
if (forward.present()) { CheckDescriptorMutableReply rep(SERVER_KNOBS->ENABLE_CROSS_CLUSTER_SUPPORT);
req.reply.sendError(coordinators_changed()); req.reply.send(rep);
} else {
CheckDescriptorMutableReply rep(SERVER_KNOBS->ENABLE_CROSS_CLUSTER_SUPPORT);
req.reply.send(rep);
}
} }
when(OpenDatabaseCoordRequest req = waitNext(interf.openDatabase.getFuture())) { when(OpenDatabaseCoordRequest req = waitNext(interf.openDatabase.getFuture())) {
Optional<LeaderInfo> forward = regs.getForward(req.clusterKey); Optional<LeaderInfo> forward = regs.getForward(req.clusterKey);