-
Notifications
You must be signed in to change notification settings - Fork 4k
testcluster: assign unique ClusterName #157868
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
Conversation
cda91e1 to
8e50d43
Compare
8e50d43 to
148d2f1
Compare
148d2f1 to
4595bb4
Compare
|
Fixed all the Here, this node is visible as cockroach/pkg/cli/zip_per_node.go Line 62 in 21eed7b
Which must eventually happen because of the decommission command: Lines 766 to 775 in 21eed7b
|
|
Ah, probably need to set |
This commit makes TestCluster by default assign unique cluster name in the TestServerArgs. The cluster name is shared by all participating or added nodes, unless overridden. Epic: none Release note: none
4595bb4 to
1757367
Compare
|
TFTRs! bors r=RaduBerinde,stevendanna |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. 💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details. error creating merge commit from 1757367 to blathers/backport-release-24.3-157868: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch release-24.3 failed. See errors above. 💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details. error creating merge commit from 1757367 to blathers/backport-release-25.2-157868: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch release-25.2 failed. See errors above. 💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details. 💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
| if clusterArgs.ServerArgs.ClusterName == "" { | ||
| // Use a cluster name that is sufficiently unique (within the CI env) but is | ||
| // concise and recognizable. | ||
| clusterArgs.ServerArgs.ClusterName = fmt.Sprintf("TestCluster-%d", rand.Uint32()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is recent evidence to suggest rand.Uint32 isn't sufficiently unique; collision probability is high after thousands of iterations [1].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll fix up.
157995: testcluster: reduce ClusterName collisions r=stevendanna,srosenberg a=pav-kv As suggested in #157868 (comment), `rand.Uint32()` has a pretty high chance of collision. This PR increases the space from `2^32` to `62^10`. Addresses #157838 Co-authored-by: Pavel Kalinnikov <[email protected]>
This commit makes
TestClusterby default assign a unique cluster name in theTestServerArgs. The cluster name is shared by all participating or added nodes, unless overridden in the per-node args.This helps preventing accidental message exchange between
TestClusters in the same environment that use the same TCP port in close proximity from each other.Addresses #157838