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

[BTS-1644] ResignLeadership + Wait #21401

Open
wants to merge 8 commits into
base: devel
Choose a base branch
from

Conversation

maierlars
Copy link
Contributor

@maierlars maierlars commented Oct 28, 2024

Scope & Purpose

Added waitForInSync and waitForInSyncTimeout parameters to the resign leadership job. This allows the user to wait for a certain amount of time to make sure that there exist common in sync followers. Previously they were just ignored and could cause downtime.

Design Doc: https://github.com/arangodb/documents/pull/136

@maierlars maierlars self-assigned this Oct 28, 2024
@cla-bot cla-bot bot added the cla-signed label Oct 28, 2024
@maierlars maierlars marked this pull request as ready for review October 29, 2024 13:40
Copy link
Contributor

@jvolmer jvolmer left a comment

Choose a reason for hiding this comment

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

I've got two type-improvement suggestions, otherwise LGTM.

<< "Not starting resign leadership job because some shards have no "
"common in sync follower";
// check if a timeout value is specified
if (_waitForInSyncTimeout > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand it correctly that if _waitForInSyncTimeout == 0, there is no timeout and we can wait indefinitely? This is a bit confusing, because 0 timeout normally just means instantly.
Possible fix: We could have an optional instead of just a number and if the the snapshot-velocypack does not include waitForInSyncTimeout, the option is std::nullopt.

@@ -55,6 +55,8 @@ struct ResignLeadership : public Job {

std::string _server;
bool _undoMoves{true};
bool _waitForInSync{false};
uint64_t _waitForInSyncTimeout{30 * 60};
Copy link
Contributor

Choose a reason for hiding this comment

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

30 minutes sound a lot to me, but perhaps this is correct.
This value is actually set per default to 0 in the ResignLeadership constructor, so I guess it is more readable to set it to zero here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another thing: I would be nice to make it visible that they both belong together - _waitForInSyncTimeout does not make any sense if _waitForInSync is false - as far as I understood.
E.g. via an std::variant<bool, std::tuple<bool, TimeoutInSec>> or with the comment above: std::variant<bool, std::tuple<bool, std::optional<TimeoutInSec>>>

@fceller fceller assigned fceller and unassigned maierlars Feb 18, 2025
Copy link

cla-bot bot commented Feb 19, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Lars Maier.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot bot removed the cla-signed label Feb 19, 2025
Copy link

cla-bot bot commented Feb 19, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Lars Maier.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@jvolmer jvolmer force-pushed the feature/bts-1644-wait-for-followers-resign-leadership branch from 0bd0aa0 to fd96027 Compare February 19, 2025 12:35
Copy link

cla-bot bot commented Feb 19, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Lars Maier.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@jvolmer jvolmer force-pushed the feature/bts-1644-wait-for-followers-resign-leadership branch from fd96027 to 4780410 Compare February 19, 2025 14:17
Copy link

cla-bot bot commented Feb 19, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Lars Maier.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@KVS85 KVS85 added this to the devel milestone Feb 20, 2025
@neunhoef
Copy link
Member

This is still relevant and I will finish it eventually, when no more pressing issues are there.

Copy link

cla-bot bot commented Feb 21, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Lars Maier.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@KVS85 KVS85 requested review from jvolmer and neunhoef February 21, 2025 10:40
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.

5 participants