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

Crashed supervisor leader initially starts as leader without elections #7636

Closed
jsirex opened this issue Apr 22, 2020 · 4 comments
Closed

Crashed supervisor leader initially starts as leader without elections #7636

jsirex opened this issue Apr 22, 2020 · 4 comments
Labels
Stale Type: Bug Issues that describe broken functionality

Comments

@jsirex
Copy link
Contributor

jsirex commented Apr 22, 2020

I have 3 supervisors running 3 postgresql servers in leader topology:

  • database-01
  • database-02
  • database-03

After all servers started leader is elected. I also have suitability hooks.
Let database-01 is leader with suitability: 2
Let database-02 and database-03 are followers with suitability: 1

steps to reproduce

  1. Stop leader supervisor -> new election is triggered
  2. Wait and see that hook[suitability] is triggered and new leader is elected
  3. Start old leader supervisor

expected result (updated)

  1. Supervisor by default starts like follower
  2. Hooks rendered only once before service init/start

actual result

Hard to say what I'm seeing. Looks like:

  1. Supervisor immediately start all services and reports "I'm the leader" from cache
  2. Some hooks re-rendered and init hook get executed
  3. No suitability hook were triggered at all (probably b/o Evaluate what conditions should automatically trigger a service election #7486)
  4. During init hook supervisor receives rumor and figured out he is not leader
  5. Hooks re-rendered and one more restart is happened
  6. Finally supervisor reports he is not leader
@jsirex jsirex added the C-bug label Apr 22, 2020
@jsirex
Copy link
Contributor Author

jsirex commented Apr 22, 2020

I tried add sleep 5 in the begging of the run hook and actual results is slightly different:

  1. Supervisor immediately start all services and reports "I'm the leader" from cache
  2. Some hooks re-rendered and init hook executed
  3. Suitability hook ONLY on database-01 is triggered and "2" is reported
  4. During init hook supervisor receives rumor and figured out he is not leader
  5. Hooks re-rendered and one more restart is happened
  6. Finally supervisor reports he is not leader

@christophermaier
Copy link
Contributor

Interesting... seems like we might want to privilege incoming rumors over cached rumors in some cases 🤔

@christophermaier christophermaier added Type: Bug Issues that describe broken functionality and removed C-bug labels Jul 24, 2020
@stale
Copy link

stale bot commented Jul 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Jul 26, 2021
@stale
Copy link

stale bot commented Aug 30, 2021

This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details.

@stale stale bot closed this as completed Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Type: Bug Issues that describe broken functionality
Projects
None yet
Development

No branches or pull requests

2 participants