This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-2.0-alpha in repository https://gitbox.apache.org/repos/asf/doris.git
commit 7045ecdfd379d50d5abde27d51529658d397a202 Author: Lei Zhang <27994433+swjtu-zhang...@users.noreply.github.com> AuthorDate: Fri Apr 21 20:58:42 2023 +0800 [bug](bdbje) Add retry for reSetupBdbEnvironment() `restore.execute()` (#18777) * In reSetupBdbEnvironment() `restore.execute()` may throw NullPointerException, add retry for `restore.execute()` --- .../apache/doris/journal/bdbje/BDBJEJournal.java | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java index 5cc1ac6e09..20cb6b0070 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java +++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java @@ -375,10 +375,25 @@ public class BDBJEJournal implements Journal { // CHECKSTYLE IGNORE THIS LINE: B // 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); + 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()); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org