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

server: remove support for sticky engines #108185

Merged
merged 2 commits into from
Aug 21, 2023
Merged

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Aug 4, 2023

Remove support for reusing engines from the StickyVFSRegistry. Tests should not
depend on ephemeral, in-memory engine state between server restarts, or read
closed Engine state.

Close #108119.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jbowens jbowens force-pushed the stickycleanup branch 2 times, most recently from a0f23e1 to 69ea217 Compare August 4, 2023 18:18
@jbowens jbowens marked this pull request as ready for review August 4, 2023 19:06
@jbowens jbowens requested a review from a team as a code owner August 4, 2023 19:06
@jbowens jbowens requested a review from a team August 4, 2023 19:06
@jbowens jbowens requested review from a team as code owners August 4, 2023 19:06
@jbowens jbowens requested a review from itsbilal August 4, 2023 19:06
@jbowens jbowens requested a review from a team as a code owner August 4, 2023 19:24
Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Are you sure about this? cockroach demo has this idea of "node restart" (\demo shutdown, \demo restart) which are meant to let people test what happens when a node is temporarily down.

By removing support for sticky engine, a \demo shutdown will be equivalent to wiping the node, and \demo restart will be equivalent to \demo add. This seems like a big feature change. At the very least it needs a release note, and probably it also needs a check-in with a PM.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal)

Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

Are you sure about this? cockroach demo has this idea of "node restart" (\demo shutdown, \demo restart) which are meant to let people test what happens when a node is temporarily down.

By removing support for sticky engine, a \demo shutdown will be equivalent to wiping the node, and \demo restart will be equivalent to \demo add.

This removes support for sticky engines but preserves support for sticky VFSes, which allows cockroach demo to preserve filesystem state between "node restarts." The primary difference is that the restart will now close and reopen the storage engine, rather than preserving ephemeral in-memory engine state across the "node restart."

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal)

@knz
Copy link
Contributor

knz commented Aug 10, 2023

gotcha. carry on!

Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

LGTM, sorry for the delay!

// must call CloseAllEngines when they're finished to close the underlying
// engines.
// filesystem. The caller should ensure any previous engine accessing the
// same VFS has already been closed.
Open(ctx context.Context, cfg *Config, spec base.StoreSpec) (storage.Engine, error)
Copy link
Member

Choose a reason for hiding this comment

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

Since the implementation for this method really only grabs the VFS from Get() and doesn't store any other state within the registry itself, thoughts on moving this out of the registry interface and just having a helper that takes a StickyVFSRegistry? Good with it either way, just throwing the idea

Remove support for reusing engines from the StickyVFSRegistry. Tests should not
depend on ephemeral, in-memory engine state between server restarts, or read
closed Engine state.

Close cockroachdb#108119.
Epic: none
Release note: none
Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal)


pkg/server/sticky_vfs.go line 44 at r2 (raw file):

Previously, itsbilal (Bilal Akhtar) wrote…

Since the implementation for this method really only grabs the VFS from Get() and doesn't store any other state within the registry itself, thoughts on moving this out of the registry interface and just having a helper that takes a StickyVFSRegistry? Good with it either way, just throwing the idea

There many fewer Open calls than I thought; Made the change to remove the Open function altogether. Good idea.

Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Reviewed 2 of 11 files at r3, 10 of 10 files at r4, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@jbowens
Copy link
Collaborator Author

jbowens commented Aug 21, 2023

TFTR!

bors r=itsbilal

@craig craig bot merged commit 604a90a into cockroachdb:master Aug 21, 2023
@craig
Copy link
Contributor

craig bot commented Aug 21, 2023

Build succeeded:

@jbowens jbowens deleted the stickycleanup branch March 10, 2024 19:09
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.

storage,server: remove ReuseEnginesDeprecated
4 participants