Skip to content

Remove leader election, step 2: allow multiple leaders#11639

Merged
alexey-milovidov merged 24 commits intomasterfrom
remove-leader-election-2
Jun 17, 2020
Merged

Remove leader election, step 2: allow multiple leaders#11639
alexey-milovidov merged 24 commits intomasterfrom
remove-leader-election-2

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov commented Jun 12, 2020

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Allow multiple replicas to assign merges, mutations, partition drop, move and replace concurrently. This closes #10367.

Includes #11637 and #11633.

Remove leader election:
step 1: update and check version of "log" node #11637
step 2: allow multiple leaders #11639
step 3: remove yielding of leadership; remove sending queries to leader. #11795

@blinkov blinkov added the pr-performance Pull request with some performance improvements label Jun 12, 2020
@alexey-milovidov
Copy link
Copy Markdown
Member Author

TODO: cleanupThread.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

TODO: support downgrade scenario.

@alexey-milovidov alexey-milovidov force-pushed the remove-leader-election-2 branch from 79a0168 to 34aa13c Compare June 13, 2020 01:35
@alexey-milovidov alexey-milovidov force-pushed the remove-leader-election-2 branch from 34aa13c to 18f8861 Compare June 13, 2020 01:35
@alexey-milovidov
Copy link
Copy Markdown
Member Author

TODO: support downgrade scenario.

Done.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

TODO: cleanupThread.

Done.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Build check:

Build failed without build log. It's inner CI problem. Maybe something wrong with docker or host. Just wait for build restart.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

alexey-milovidov commented Jun 16, 2020

@nikitamikhaylov

I have found that the new behaviour in test test_quorum_inserts/test.py::test_insert_quorum_with_ttl is absolutely correct.

Old behaviour:

insert_quorum = 2
two replicas: 0 and 1

create table on replica 0 and 1
replica 0 becomes leader
stop fetches on replica 1
insert on replica 0
quorum is not satisfied
replica 0 cannot assign merges because quorum is not satisfied
resume fetches on replica 1
replica 1 downloaded part and quorum is satisfied
replica 0 can assign merges but sleeps from previous attempt
replica 1 cannot assign merges because it's not a leader
data is not merged and SELECT returns 1 row

New behaviour:

insert_quorum = 2
two replicas: 0 and 1

create table on replica 0 and 1
replica 0 becomes leader
replica 1 also becomes leader
stop fetches on replica 1
insert on replica 0
quorum is not satisfied
replica 0 cannot assign merges because quorum is not satisfied
replica 1 cannot assign merges because there are no parts
resume fetches on replica 1
replica 1 downloaded part and quorum is satisfied
replica 1 start to assign merges immediately
replica 1 assigned merge because quorum is satisfied and merged part from 1 to 0 rows
replica 0 pulls logs from queue and performs the same merge
data is merged and SELECT returns 0 rows

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Build check:

Build failed without build log. It's inner CI problem. Maybe something wrong with docker or host. Just wait for build restart.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

Build check:

Build failed without build log. It's inner CI problem. Maybe something wrong with docker or host. Just wait for build restart.

It started to be annoying.

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

Labels

no-docs-needed pr-performance Pull request with some performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get rid of leader election in ReplicatedMergeTree tables.

3 participants