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

storage: messing with Liveness.IsHealthy #43873

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

andreimatei
Copy link
Contributor

See individual commits.

NodeLiveness.IsHealthy() was passing a non-sensical threshold to the
function determining whether a node is supposed to be dead. It was
passing the duration of a liveness period, but that duration had already
been incorporated in the liveness' expiration.
I believe this is inconsequential because this IsHealthy() only cares
about LIVE nodes, and that state was not affected by this threshold
(i.e. if the node would have been considered dead according to any
positive threshold, it won't be onsidered live).

Release note: None
IsHealthy() is a very specific function with a single caller. It doesn't
deserve to live next to the other liveness code (which code is confusing
enough without it). This patch embeds it in the caller.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, 1 of 2 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner, @andreimatei, and @asubiotto)


pkg/server/status.go, line 676 at r2 (raw file):

	ls := l.LivenessStatus(
		clock.PhysicalTime(),
		0, /* threshold */

Do you not want to remove this parameter while you're here?

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

I'm cool with this under the expectation that you clean up this mess and remove that threshold in future PRs.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @asubiotto)

Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

yeah, I'm trying

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @asubiotto)

Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @asubiotto)

@craig
Copy link
Contributor

craig bot commented Jan 10, 2020

Build failed

Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

acceptance/version-upgrade timed out. Couldn't repro.

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @asubiotto)

craig bot pushed a commit that referenced this pull request Jan 10, 2020
43873: storage: messing with Liveness.IsHealthy r=andreimatei a=andreimatei

See individual commits.

Co-authored-by: Andrei Matei <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 10, 2020

Build succeeded

@craig craig bot merged commit 14780dd into cockroachdb:master Jan 10, 2020
@andreimatei andreimatei deleted the liveness.IsHealthy branch January 14, 2020 00:50
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