Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug](bdbje) Add retry for reSetupBdbEnvironment() restore.execute() #18777

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,25 @@ private void reSetupBdbEnvironment(InsufficientLogException insufficientLogEx) {
// ATTN: here we use `getServingEnv()`, because only serving catalog has
// helper nodes.
HostInfo helperNode = Env.getServingEnv().getHelperNode();
NetworkRestore restore = new NetworkRestore();
NetworkRestoreConfig config = new NetworkRestoreConfig();
config.setRetainLogFiles(false);
restore.execute(insufficientLogEx, config);

for (int i = 0; i < RETRY_TIME; i++) {
try {
NetworkRestore restore = new NetworkRestore();
NetworkRestoreConfig config = new NetworkRestoreConfig();
config.setRetainLogFiles(false);
restore.execute(insufficientLogEx, config);
Comment on lines +379 to +384
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the logic here, but it looks like you're retrying up to the maximum number of times, even if it was successful before then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the logic here, but it looks like you're retrying up to the maximum number of times, even if it was successful before then.

Thanks for your comment, i have added a break here.

break;
} catch (Exception e) {
LOG.warn("retry={}, reSetupBdbEnvironment exception:", i, e);
try {
Thread.sleep(5 * 1000);
LOG.warn("after sleep insufficientLogEx:", insufficientLogEx);
} catch (InterruptedException e1) {
LOG.warn("InterruptedException", e1);
}
}
}

bdbEnvironment.close();
bdbEnvironment.setup(new File(environmentPath), selfNodeName, selfNodeHostPort,
helperNode.getIp() + ":" + helperNode.getPort(), Env.getServingEnv().isElectable());
Expand Down