Skip to content

storage: sort InternalReplicas before comparing#38593

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
jeffrey-xiao:fix-internal-replicas
Jul 2, 2019
Merged

storage: sort InternalReplicas before comparing#38593
craig[bot] merged 1 commit intocockroachdb:masterfrom
jeffrey-xiao:fix-internal-replicas

Conversation

@jeffrey-xiao
Copy link
Copy Markdown
Contributor

Fixes an issue where the in-memory copy of RangeDescriptor is out-of-sync with the copy in kv.

Should resolve the failure in this #36983 (comment)

The import step of tpcc/mixed-headroom/n5cpu16 passes on 2811e0f + #38465 + this PR.

cc @asubiotto

@jeffrey-xiao jeffrey-xiao requested review from a team, ajwerner and nvb July 1, 2019 20:53
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

return nil, errors.Wrap(err, "decoding current range descriptor value")
}
}
// TODO(jeffreyxiao): This is hacky fix to ensure that we don't fail the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Either This is a hacky fix is to ensure or This hacky fix is to ensure?

}
// TODO(jeffreyxiao): This is hacky fix to ensure that we don't fail the
// conditional get because of the ordering of InternalReplicas. Calling
// Replicas() will sort the list of InternalReplicas as a side-effect. The
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add some more details about when and why this sorting became necessary?

@jeffrey-xiao jeffrey-xiao force-pushed the fix-internal-replicas branch from a7c860d to 2ed5d15 Compare July 1, 2019 21:03
Copy link
Copy Markdown
Contributor Author

@jeffrey-xiao jeffrey-xiao left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner and @nvanbenschoten)


pkg/storage/replica_command.go, line 1258 at r1 (raw file):

Previously, ajwerner wrote…

Either This is a hacky fix is to ensure or This hacky fix is to ensure?

Done.


pkg/storage/replica_command.go, line 1260 at r1 (raw file):

Previously, ajwerner wrote…

Can you add some more details about when and why this sorting became necessary?

Done.

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner, @jeffrey-xiao, and @nvanbenschoten)


pkg/storage/replica_command.go, line 1269 at r2 (raw file):

	// ReplicaDescriptors.Learners().
	existingDesc.Replicas()
	expectation.Replicas()
existingDesc.Replicas() // for sorting side-effect
expectation.Replicas() // for sorting side-effect

Copy link
Copy Markdown
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

LGTM2

Fixes an issue where the in-memory copy of RangeDescriptor is
out-of-sync with the copy in kv.

Release note: None
@jeffrey-xiao jeffrey-xiao force-pushed the fix-internal-replicas branch from 2ed5d15 to b44a71d Compare July 1, 2019 21:35
@asubiotto asubiotto mentioned this pull request Jul 2, 2019
14 tasks
@jeffrey-xiao
Copy link
Copy Markdown
Contributor Author

TFTRs!

bors r+

craig bot pushed a commit that referenced this pull request Jul 2, 2019
38593: storage: sort InternalReplicas before comparing r=jeffrey-xiao a=jeffrey-xiao

Fixes an issue where the in-memory copy of RangeDescriptor is out-of-sync with the copy in kv.

Should resolve the failure in this #36983 (comment)

The import step of `tpcc/mixed-headroom/n5cpu16` passes on `2811e0f` + #38465 + this PR.

cc @asubiotto 

Co-authored-by: Jeffrey Xiao <jeffrey.xiao1998@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 2, 2019

Build succeeded

@craig craig bot merged commit b44a71d into cockroachdb:master Jul 2, 2019
@jeffrey-xiao jeffrey-xiao deleted the fix-internal-replicas branch August 15, 2019 17:48
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.

4 participants