mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
remove forwarding
This commit is contained in:
parent
10289ef8f1
commit
cc3175fc50
@ -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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user