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

test: cover split-brain during promote #9944

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Serpentian
Copy link
Contributor

This test checks, that when PROMOTE from the prevous term is encountered we immediately notice split-brain situation and break replication without corrupting data.

Closes #9943

NO_DOC=test
NO_CHANGELOG=test

@Serpentian Serpentian force-pushed the cover-promote-split-brain branch 2 times, most recently from e6c6a8c to a0cdee6 Compare April 11, 2024 14:31
@coveralls
Copy link

coveralls commented Apr 11, 2024

Coverage Status

coverage: 87.043% (-0.01%) from 87.054%
when pulling 71f904d on Serpentian:cover-promote-split-brain
into 03445e6
on tarantool:master
.

Copy link
Collaborator

@Gerold103 Gerold103 left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

Comment on lines 99 to 101
t.helpers.retrying({}, function()
t.assert_not_equals(g.rs.servers[1]:grep_log('ER_SPLIT_BRAIN'), nil)
end)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you instead get it from the info.replication from upstream/downstream status? Log greps is the last resort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, it's better to check box.info.replication.upstream

This test checks, that when PROMOTE from the previous term is
encountered we immediately notice split-brain situation and break
replication without corrupting data.

Closes tarantool#9943

NO_DOC=test
NO_CHANGELOG=test
Copy link
Collaborator

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

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

Thanks for the test!
Please consider adding this case to the test/replication-luatest/gh_5295_split_brain_test.lua test. It contains all the similar split-brain test cases. I was sure that the case with an old promote is also handled there, but apparently it's not.

Copy link
Collaborator

@Gerold103 Gerold103 left a comment

Choose a reason for hiding this comment

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

Thanks for the test!

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

Successfully merging this pull request may close these issues.

Cover with tests, that promote of the previous term is detected and causes Split Brain
4 participants