Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Fix double reincarnation #72

Merged
merged 6 commits into from
Jun 13, 2016
Merged

Fix double reincarnation #72

merged 6 commits into from
Jun 13, 2016

Conversation

thanodnl
Copy link
Contributor

@thanodnl thanodnl commented Jun 9, 2016

This PR adds an integration tests assessing that reincarnation only happens for changes that would actually override the state of the node and don't reincarnate if the change will not result in an overridden state.

status: 'suspect',
subjectIncNoDelta: -1 // send a gossip with an older incarnation number
}),
dsl.waitForPingResponse(t, tc, 0, 1, true),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the extra 2 arguments (1, true)? waitForPingResponse only expects three? (https://github.com/uber/ringpop-common/blob/5cc7e1dcdf5fa7feb8b8b625f15ac22b5ce781f9/test/ringpop-assert.js#L269)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, that is strange. I cheated a bit and took the base of this test from here: https://github.com/uber/ringpop-common/blob/fix/double-reincarnation/test/incarnation-no-tests.js#L34

I will remove it in this test 😃

@mennopruijssers
Copy link
Contributor

one question but: LGTM!

@@ -896,7 +896,7 @@ function piggyback(tc, opts) {

if(opts.subjectIx === 'sut') {
update.address = tc.sutHostPort;
update.sourceIncarnationNumber = tc.test_state['sutIncarnationNumber'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help me understand why this change is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is hard to see without more context, but the piggyback function consists of roughly two parts. The first part is about the source of the gossip, the second part is about the subject. We are here in the part that is about the subject.

Even though we are setting the subject information this line had a bug where the incarnation number of the source of the gossip was set to the incarnation number of the sut. If you look at a bit more context below this line you will see that all branches set the incarnationNumber except for this branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. Thank you!

@motiejus
Copy link
Contributor

LGTM for the test, but see my question about the last line of the patch.

@motiejus
Copy link
Contributor

LGTM

@thanodnl thanodnl merged commit a933e2e into master Jun 13, 2016
@thanodnl thanodnl deleted the fix/double-reincarnation branch June 13, 2016 09:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants