[fix](ccr) Mark getBinlog,getBinlogLag,getMeta,getBackendMeta as from master (#27211)
Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
This commit is contained in:
@ -2796,6 +2796,15 @@ public class FrontendServiceImpl implements FrontendService.Iface {
|
||||
TGetBinlogResult result = new TGetBinlogResult();
|
||||
TStatus status = new TStatus(TStatusCode.OK);
|
||||
result.setStatus(status);
|
||||
|
||||
if (!Env.getCurrentEnv().isMaster()) {
|
||||
status.setStatusCode(TStatusCode.NOT_MASTER);
|
||||
status.addToErrorMsgs(NOT_MASTER_ERR_MSG);
|
||||
result.setMasterAddress(getMasterAddress());
|
||||
LOG.error("failed to get beginTxn: {}", NOT_MASTER_ERR_MSG);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
result = getBinlogImpl(request, clientAddr);
|
||||
} catch (UserException e) {
|
||||
@ -3137,6 +3146,14 @@ public class FrontendServiceImpl implements FrontendService.Iface {
|
||||
TStatus status = new TStatus(TStatusCode.OK);
|
||||
result.setStatus(status);
|
||||
|
||||
if (!Env.getCurrentEnv().isMaster()) {
|
||||
status.setStatusCode(TStatusCode.NOT_MASTER);
|
||||
status.addToErrorMsgs(NOT_MASTER_ERR_MSG);
|
||||
result.setMasterAddress(getMasterAddress());
|
||||
LOG.error("failed to get beginTxn: {}", NOT_MASTER_ERR_MSG);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
result = getBinlogLagImpl(request, clientAddr);
|
||||
} catch (UserException e) {
|
||||
@ -3385,6 +3402,15 @@ public class FrontendServiceImpl implements FrontendService.Iface {
|
||||
TGetMetaResult result = new TGetMetaResult();
|
||||
TStatus status = new TStatus(TStatusCode.OK);
|
||||
result.setStatus(status);
|
||||
|
||||
if (!Env.getCurrentEnv().isMaster()) {
|
||||
status.setStatusCode(TStatusCode.NOT_MASTER);
|
||||
status.addToErrorMsgs(NOT_MASTER_ERR_MSG);
|
||||
result.setMasterAddress(getMasterAddress());
|
||||
LOG.error("failed to get beginTxn: {}", NOT_MASTER_ERR_MSG);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
result = getMetaImpl(request, clientAddr);
|
||||
} catch (UserException e) {
|
||||
@ -3524,6 +3550,15 @@ public class FrontendServiceImpl implements FrontendService.Iface {
|
||||
TGetBackendMetaResult result = new TGetBackendMetaResult();
|
||||
TStatus status = new TStatus(TStatusCode.OK);
|
||||
result.setStatus(status);
|
||||
|
||||
if (!Env.getCurrentEnv().isMaster()) {
|
||||
status.setStatusCode(TStatusCode.NOT_MASTER);
|
||||
status.addToErrorMsgs(NOT_MASTER_ERR_MSG);
|
||||
result.setMasterAddress(getMasterAddress());
|
||||
LOG.error("failed to get beginTxn: {}", NOT_MASTER_ERR_MSG);
|
||||
return result;
|
||||
}
|
||||
|
||||
try {
|
||||
result = getBackendMetaImpl(request, clientAddr);
|
||||
} catch (UserException e) {
|
||||
|
||||
Reference in New Issue
Block a user