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

[Enhancement] Support recover FE metadata from backup meta #50966

Conversation

gengjun-git
Copy link
Contributor

@gengjun-git gengjun-git commented Sep 11, 2024

Why I'm doing:

With this patch, it is possible to recover FE metadata if all machines are unavailable but the meta directory still exists.

  1. Start a FE node with the backup meta using config bdbje_reset_election_group = true in fe.conf. We call this FE as FE_TMP.
  2. Add another Follower node to this cluster. We call this FE as FE_NORMAL.
  3. Make sure FE_NORMAL is added to cluster successfully. Stop FE_TMP, and this node will be never used.
  4. Add bdbje_reset_election_group = true to fe.conf, and restart FE_NORMAL.
  5. Connect FE_NORMAL and make sure the meta is normal.
  6. Remove bdbje_reset_election_group = true from fe.conf, and restart FE_NORMAL.
  7. Connect to FE_NORMAL and remove all the other FE nodes.

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

Signed-off-by: gengjun-git <gengjun@starrocks.com>
@gengjun-git gengjun-git force-pushed the catch_exception_if_cannot_find_master branch from 90927f4 to f113f34 Compare September 11, 2024 09:22
Copy link

sonarcloud bot commented Sep 11, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

fail : 7 / 13 (53.85%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/ha/BDBHA.java 0 4 00.00% [162, 163, 187, 188]
🔵 com/starrocks/server/NodeMgr.java 4 6 66.67% [770, 771]
🔵 com/starrocks/journal/bdbje/BDBEnvironment.java 2 2 100.00% []
🔵 com/starrocks/common/Config.java 1 1 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@nshangyiming nshangyiming self-assigned this Sep 12, 2024
@@ -160,8 +159,8 @@ public List<InetSocketAddress> getObserverNodes() {
for (ReplicationNode replicationNode : replicationGroup.getSecondaryNodes()) {
ret.add(replicationNode.getSocketAddress());
}
} catch (UnknownMasterException e) {
LOG.warn("Catch UnknownMasterException when calling getObserverNodes.", e);
} catch (Throwable t) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this?

} catch (UnknownMasterException e) {
LOG.warn("Catch UnknownMasterException when calling getObserverNodes.", e);
} catch (Throwable t) {
LOG.warn("Catch Exception when calling getObserverNodes.", t);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOG.warn("Catch Exception when calling getObserverNodes.", t);
LOG.warn("got exception when calling getObserverNodes.", t);

} catch (UnknownMasterException e) {
LOG.warn("Catch UnknownMasterException when calling getElectableNodes.", e);
} catch (Throwable t) {
LOG.warn("catch exception when calling getElectableNodes.", t);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOG.warn("catch exception when calling getElectableNodes.", t);
LOG.warn("got exception when calling getElectableNodes.", t);

@gengjun-git
Copy link
Contributor Author

replace by #51040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants