Skip to content

Commit

Permalink
[fix](heartbeat) fill default value for required field in TFrontendPi…
Browse files Browse the repository at this point in the history
…ngFrontendResult
  • Loading branch information
morningman committed Oct 9, 2024
1 parent fc0279b commit 7f3c3c1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,14 @@ public TStatus snapshotLoaderReport(TSnapshotLoaderReportRequest request) throws
public TFrontendPingFrontendResult ping(TFrontendPingFrontendRequest request) throws TException {
boolean isReady = Env.getCurrentEnv().isReady();
TFrontendPingFrontendResult result = new TFrontendPingFrontendResult();
// The following fields are required in thrift.
// So must give them a default value to avoid "Required field xx was not present" error.
result.setStatus(TFrontendPingFrontendStatusCode.OK);
result.setMsg("");
result.setQueryPort(0);
result.setRpcPort(0);
result.setReplayedJournalId(0);
result.setVersion(Version.DORIS_BUILD_VERSION + "-" + Version.DORIS_BUILD_SHORT_HASH);
if (isReady) {
if (request.getClusterId() != Env.getCurrentEnv().getClusterId()) {
result.setStatus(TFrontendPingFrontendStatusCode.FAILED);
Expand Down

0 comments on commit 7f3c3c1

Please sign in to comment.