[cherry-pick](branch-2.1) Fix some group commit forward to master problems (#38345)

## Proposed changes

<!--Describe your changes.-->

Pick #38228 #38265
This commit is contained in:
abmdocrt
2024-07-25 14:48:02 +08:00
committed by GitHub
parent 4288f09e8c
commit 32530113cf
2 changed files with 5 additions and 2 deletions

View File

@ -365,6 +365,9 @@ public class LoadAction extends RestBaseController {
ctx.setEnv(Env.getCurrentEnv());
ctx.setThreadLocalInfo();
ctx.setRemoteIP(request.getRemoteAddr());
// We set this variable to fulfill required field 'user' in
// TMasterOpRequest(FrontendService.thrift)
ctx.setQualifiedUser(Auth.ADMIN_USER);
ctx.setThreadLocalInfo();
try {

View File

@ -1010,7 +1010,7 @@ public class FrontendServiceImpl implements FrontendService.Iface {
result.setPacket("".getBytes());
return result;
}
if (params.getGroupCommitInfo().isGetGroupCommitLoadBeId()) {
if (params.getGroupCommitInfo() != null && params.getGroupCommitInfo().isGetGroupCommitLoadBeId()) {
final TGroupCommitInfo info = params.getGroupCommitInfo();
final TMasterOpResult result = new TMasterOpResult();
try {
@ -1023,7 +1023,7 @@ public class FrontendServiceImpl implements FrontendService.Iface {
result.setPacket("".getBytes());
return result;
}
if (params.getGroupCommitInfo().isUpdateLoadData()) {
if (params.getGroupCommitInfo() != null && params.getGroupCommitInfo().isUpdateLoadData()) {
final TGroupCommitInfo info = params.getGroupCommitInfo();
final TMasterOpResult result = new TMasterOpResult();
Env.getCurrentEnv().getGroupCommitManager()