Skip to content

Conversation

@tbg
Copy link
Member

@tbg tbg commented Nov 10, 2025

This PR adds the basic capability to exercise rebalanceStores through
TestClusterState. It does this by moving rebalanceStores from allocatorState to
clusterState, which is a small and mostly mechanical refactor.

The immediate motivation behind this change is being able to exercise
the functionality for #156776 while it is being added, while being able
to see the internal tracepoints as well.

Informs #156776.

Epic: CRDB-55052

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg changed the title mmaprototype: add datadriven testing to rebalanceStores mmaprototype: add tracing to testing for rebalanceStores Nov 10, 2025
@tbg tbg force-pushed the mma-rebalance-refactor-auto branch 2 times, most recently from af0a3a3 to b852857 Compare November 10, 2025 15:27
@tbg tbg marked this pull request as ready for review November 10, 2025 15:27
@tbg tbg requested review from a team as code owners November 10, 2025 15:27
@tbg tbg requested review from a team, Abhinav1299, aa-joshi, arjunmahishi, jasonlmfong, sumeerbhola and wenyihu6 and removed request for a team November 10, 2025 15:27
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

:lgtm:

@sumeerbhola reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aa-joshi, @Abhinav1299, @arjunmahishi, @jasonlmfong, and @wenyihu6)

Copy link
Contributor

@wenyihu6 wenyihu6 left a comment

Choose a reason for hiding this comment

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

mod the comment

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aa-joshi, @Abhinav1299, @arjunmahishi, and @jasonlmfong)


pkg/kv/kvserver/allocator/mmaprototype/cluster_state_test.go line 524 at r2 (raw file):

					rng := rand.New(rand.NewSource(0))
					dsm := newDiversityScoringMemo()
					tr := tracing.NewTracer()

do we need to call tr.Close in the end like this

?

@tbg tbg force-pushed the mma-rebalance-refactor-auto branch from b852857 to 0c5fa80 Compare November 12, 2025 07:47
Copy link
Member Author

@tbg tbg 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 (and 1 stale) (waiting on @aa-joshi, @Abhinav1299, @arjunmahishi, @jasonlmfong, @sumeerbhola, and @wenyihu6)


pkg/kv/kvserver/allocator/mmaprototype/cluster_state_test.go line 524 at r2 (raw file):

Previously, wenyihu6 (Wenyi Hu) wrote…

do we need to call tr.Close in the end like this

?

We should, thanks. Added.

tbg added 3 commits November 12, 2025 14:54
I'd like to make the trace events emitted from deterministic multi-metric
allocator tests part of the expected test outputs.

I realized there wasn't a standardized deterministic and barebones output
format, so I added one.

Epic: none
close tracer, ./dev gen bazel, set tracer redactable (make sure we get good debug output in production)
@tbg tbg force-pushed the mma-rebalance-refactor-auto branch from 0c5fa80 to 754bacd Compare November 12, 2025 13:54
Copy link
Contributor

@wenyihu6 wenyihu6 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 (and 1 stale) (waiting on @aa-joshi, @Abhinav1299, @arjunmahishi, @jasonlmfong, and @sumeerbhola)

craig bot pushed a commit that referenced this pull request Nov 12, 2025
157132: tracing: add minimal format suitable for datadriven tests r=wenyihu6 a=tbg

I'd like to make the trace events emitted from deterministic multi-metric allocator tests part of the expected test outputs.

I realized there wasn't a standardized deterministic and barebones output format, so I added one. In the test I have in mind I'll probably condense the file:line prefix further, but it seemed unsavory to slap regexp transformations into the tracing packages, and unfortunately that is required to solve the problem if we want to avoid changing the `log` package.

Related to #157133.

Epic: none

157150: cloud/azure: add optional azure client caching r=dt a=dt

This adds a signle-slot, process-wide in-memory cache of the most recently used azure SDK storage client allowing subsequent attempts to open clients with the same configuration to reuse the already open client. This can allow the SDK's internal caching of things like IMDS tokens to be used across separate CRDB operations on separate files which currently each open their own client.

This can be particularly impactful for avoiding hitting the IMDS rate limit.

Release note: none.
Epic: none.

157217: mmaprototype: move rebalanceStores to its own file r=wenyihu6 a=tbg

Epic: CRDB-55052

Co-authored-by: Tobias Grieger <[email protected]>
Co-authored-by: David Taylor <[email protected]>
@tbg
Copy link
Member Author

tbg commented Nov 12, 2025

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 12, 2025

@craig craig bot merged commit dd5bc70 into cockroachdb:master Nov 12, 2025
24 checks passed
@tbg
Copy link
Member Author

tbg commented Nov 12, 2025

Ugh, wanted to unstack this before merging and squash the fixup commit. Making a mental note to add do-not-merge label when in that state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants