Skip to content

allocator: correct node count calculations with overrides#94983

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
AlexTalks:dpf_fix_node_count
Jan 25, 2023
Merged

allocator: correct node count calculations with overrides#94983
craig[bot] merged 1 commit intocockroachdb:masterfrom
AlexTalks:dpf_fix_node_count

Conversation

@AlexTalks
Copy link
Copy Markdown
Contributor

While we are correctly using the overrides set in the
OverrideStorePool for the purposes of the node liveness function, the
node count function did not properly incorporate the overrides
previously. This change rectifies that, using the preset overrides
specified at creation of the override store pool to calculate the number
of non-decommissioning, non-decommissioned nodes (alive or dead), as
viewed by the override store pool. This allows for correct calculation
of the number of needed voters, allowing us to correctly determine which
allocation action is needed for a range.

Depends on #93758.

Epic: CRDB-20924

Release note: None

@AlexTalks AlexTalks requested review from a team as code owners January 10, 2023 08:45
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@kvoli kvoli left a comment

Choose a reason for hiding this comment

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

It looks like some tests need to be updated to use the newer fn signature.

pkg/kv/kvserver/allocator/storepool/override_store_pool_test.go:43:44: not enough arguments in call to NewOverrideStorePool
	have (*StorePool, func(nid roachpb.NodeID, now time.Time, timeUntilStoreDead time.Duration) livenesspb.NodeLivenessStatus)
	want (*StorePool, NodeLivenessFunc, NodeCountFunc)

:lgtm:

Reviewed 3 of 3 files at r1, 4 of 4 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @AlexTalks)


-- commits line 2 at r1:
Is this commit already merged into master?

Copy link
Copy Markdown
Contributor

@kvoli kvoli left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 7 files at r3, 7 of 7 files at r4, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @AlexTalks)

While we are correctly using the overrides set in the
`OverrideStorePool` for the purposes of the node liveness function, the
node count function did not properly incorporate the overrides
previously. This change rectifies that, using the preset overrides
specified at creation of the override store pool to calculate the number
of non-decommissioning, non-decommissioned nodes (alive or dead), as
viewed by the override store pool. This allows for correct calculation
of the number of needed voters, allowing us to correctly determine which
allocation action is needed for a range.

Depends on cockroachdb#93758.

Epic: CRDB-20924

Release note: None
@AlexTalks
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 25, 2023

Build succeeded:

@craig craig bot merged commit 26be5f2 into cockroachdb:master Jan 25, 2023
@AlexTalks AlexTalks deleted the dpf_fix_node_count branch January 26, 2023 04:45
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.

3 participants