Skip to content

cli: exit without error on repeated decommission#103555

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
AlexTalks:dpf_errcode
May 26, 2023
Merged

cli: exit without error on repeated decommission#103555
craig[bot] merged 1 commit intocockroachdb:masterfrom
AlexTalks:dpf_errcode

Conversation

@AlexTalks
Copy link
Copy Markdown
Contributor

With the introduction of decommission pre-checks executed by the CLI in #96100, the decommission readiness was used to exit with a non-zero exit code when a node is not ready to be decommissioned. However, as the decommission command is intended to be idempotent, decommissioning an already decommissioned node should not be considered an error, especially since we already print a warning stating as such. This change fixes that check to exit with a code of 0 if a node has already been decommissioned.

Fixes: #98149.

Release note (cli change): Running cockroch node decommission <nodeID> for a node that has already been decommissioned will now exit with code 0, as had been the case in CockroachDB versions prior to 23.1.0.

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented May 17, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@AlexTalks AlexTalks added the backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only label May 17, 2023
With the introduction of decommission pre-checks executed by the CLI in cockroachdb#96100,
the decommission readiness was used to exit with a non-zero exit code
when a node is not ready to be decommissioned. However, as the
decommission command is intended to be idempotent, decommissioning an
already decommissioned node should not be considered an error,
especially since we already print a warning stating as such. This change
fixes that check to exit with a code of 0 if a node has already been
decommissioned.

Fixes: cockroachdb#98149.

Release note (cli change): Running `cockroch node decommission <nodeID>`
for a node that has already been decommissioned will now exit with code
0, as had been the case in CockroachDB versions prior to 23.1.0.
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 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @AlexTalks)

@AlexTalks
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 26, 2023

Build succeeded:

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

Labels

backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: run decommission checks without exiting with error on blockers

3 participants