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

TestSplitKeyspaceGroup "Condition never satisfied" randomly #6571

Closed
binshi-bing opened this issue Jun 7, 2023 · 2 comments · Fixed by #6584
Closed

TestSplitKeyspaceGroup "Condition never satisfied" randomly #6571

binshi-bing opened this issue Jun 7, 2023 · 2 comments · Fixed by #6584
Assignees
Labels
type/ci The issue is related to CI.

Comments

@binshi-bing
Copy link
Contributor

Flaky Test

Which jobs are failing

--- FAIL: TestSplitKeyspaceGroup (44.24s)
testutil.go:63:
Error Trace: /home/runner/work/pd/pd/pkg/utils/testutil/testutil.go:63
/home/runner/work/pd/pd/tests/pdctl/keyspace/keyspace_group_test.go:124
Error: Condition never satisfied
Test: TestSplitKeyspaceGroup

CI link

https://github.com/tikv/pd/actions/runs/5203268375/jobs/9385886991?pr=6565

Reason for failure (if possible)

unknown

Anything else

@binshi-bing binshi-bing added the type/ci The issue is related to CI. label Jun 7, 2023
@lhy1024
Copy link
Contributor

lhy1024 commented Jun 9, 2023

In https://github.com/tikv/pd/actions/runs/5218488382/jobs/9420912472?pr=6584, I added some log.

2023-06-09T07:14:02.5578661Z [2023/06/09 07:13:38.570 +00:00] [INFO] [tso_keyspace_group.go:691] ["alloc nodes for keyspace group"] [keyspace-group-id=0] [nodes="[{\"address\":\"http://127.0.0.1:33849\"},{\"address\":\"http://127.0.0.1:41395\"}]"]
2023-06-09T07:14:02.5578956Z [2023/06/09 07:13:38.573 +00:00] [INFO] [tso_keyspace_group.go:193] ["all keyspace groups have equal or more than default replica count, stop to alloc node"]
....
2023-06-09T07:14:02.6855813Z [2023/06/09 07:13:42.792 +00:00] [INFO] [keyspace_group_test.go:143] ["split output"] [output="Failed! [500] \"not enough replicas in the keyspace group\""]

@lhy1024
Copy link
Contributor

lhy1024 commented Jun 9, 2023

This is because UpdateKeyspaceForGroup overrides the result of allocNodesToAllKeyspaceGroups

pd server T1 T2 T3
A GroupManager.Bootstrap creates default keyspace group and put it into GroupManager.groups ... keyspaceManager.Bootstrap preallocate keyspace and updateKeyspaceForGroupLocked overwrite default keyspace group with nil member, which is from GroupManager.groups
B ... allocNodesToAllKeyspaceGroups load default keyspace group and alloc node for it ...

So, we need to run allocNodesToAllKeyspaceGroups only on pd leader and updateKeyspaceForGroupLocked cannot modify other params

ti-chi-bot bot pushed a commit that referenced this issue Jun 13, 2023
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/ci The issue is related to CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants