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

Prototype: Read-only ring state #546

Closed
wants to merge 7 commits into from
Closed

Prototype: Read-only ring state #546

wants to merge 7 commits into from

Conversation

pr00se
Copy link
Contributor

@pr00se pr00se commented Jul 16, 2024

What this PR does:

This is a draft PR that adds a new READONLY InstanceState, and support to set the joinedState before starting the lifecycler.

  • joinedState defaults to ACTIVE
  • during startup, lifecycler will automatically join the ring in the joinedState
  • only valid joinedStates are ACTIVE and READONLY
  • allowed transitions:
    • ACTIVE -> READONLY
    • READONLY -> ACTIVE
    • PENDING -> READONLY
    • READONLY -> LEAVING
  • augmented existing tests

Notes and/or TODOs:

  • joinedState could (should?) be a config option instead, if we don't ever need to change it after creating the lifecycler
  • setting joinedState after the lifecycler has joined the ring has no effect
    • i haven't tested, or done anything to prevent, setting it WHILE the lifecycler is joining (e.g. while it is waiting before joining, or observing tokens) -- what should happen here?
  • if joinedState is set to READONLY but the lifecycler finds the instance in the ACTIVE state in the ring, it won't switch the ring state to match joinedState -- it probably should
  • there are no existing tests for the cfg.ObservePeriod setting, but we should probably add some
  • not sure if the TransferChunks state transitions are still necessary, and if we need to add JOINING -> READONLY as a valid one
  • I didn't touch any of the actual operations or health checks yet -- e.g.: READONLY instances should be healthy for purposes of IsHealthy(), and used for Read operations.

Which issue(s) this PR fixes:

Fixes #

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@pr00se pr00se marked this pull request as draft July 16, 2024 21:50
@pr00se pr00se closed this Aug 19, 2024
@pr00se pr00se changed the title Readonly state Prototype: Read-only ring state Aug 20, 2024
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.

1 participant