Skip to content

chore: copy localblocks into livestore module#6808

Merged
javiermolinar merged 8 commits intografana:mainfrom
javiermolinar:chore/livestore-own-localblock
Mar 27, 2026
Merged

chore: copy localblocks into livestore module#6808
javiermolinar merged 8 commits intografana:mainfrom
javiermolinar:chore/livestore-own-localblock

Conversation

@javiermolinar
Copy link
Copy Markdown
Contributor

@javiermolinar javiermolinar commented Mar 27, 2026

What this PR does:

As of today Livestore references the localblocks implementation from the ingester module. Since we plan to remove that module soon we can just copy the code into the livestore.

Which issue(s) this PR fixes:
Fixes #

Checklist

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

Copilot AI review requested due to automatic review settings March 27, 2026 08:10
@javiermolinar javiermolinar changed the title chore: own local block and partition ring helpers chore: copy localblocks into livestore module Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR moves (duplicates) the ingester’s local block and partition ring helper types into the livestore module, removing modules/livestore’s dependency on modules/ingester for those helpers.

Changes:

  • Add livestore.PartitionRingConfig and update livestore.Config to use it.
  • Add livestore.LocalBlock and switch reload/search paths to use it instead of ingester.LocalBlock.
  • Add a restart test ensuring invalid complete blocks are dropped during replay.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
modules/livestore/partition_ring.go Introduces PartitionRingConfig local to the livestore module.
modules/livestore/local_block.go Introduces LocalBlock wrapper for local backend blocks (search/flush + flushed marker).
modules/livestore/config.go Switches Config.PartitionRing from ingester.PartitionRingConfig to livestore.PartitionRingConfig.
modules/livestore/live_store_background.go Uses livestore.NewLocalBlock during complete-block reload.
modules/livestore/instance.go Stores completed blocks as *livestore.LocalBlock and constructs them via NewLocalBlock.
modules/livestore/instance_search.go Updates type assertions and goroutine signatures to use *livestore.LocalBlock.
modules/livestore/instance_search_test.go Updates test-local types from *ingester.LocalBlock to *livestore.LocalBlock.
modules/livestore/live_store_test.go Adds a test that corrupts a complete block and asserts it’s dropped on restart.
CHANGELOG.md Adds a changelog entry for this user-facing/internal change.

Comment thread modules/livestore/live_store_test.go Outdated
Comment thread modules/livestore/partition_ring.go Outdated
Comment thread modules/livestore/partition_ring.go
Comment thread modules/livestore/live_store_test.go
Copilot AI review requested due to automatic review settings March 27, 2026 08:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread modules/livestore/live_store_test.go Outdated
Comment thread modules/livestore/config.go
Comment thread modules/livestore/live_store_test.go Outdated
Copilot AI review requested due to automatic review settings March 27, 2026 08:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@javiermolinar javiermolinar merged commit c4f6452 into grafana:main Mar 27, 2026
27 checks passed
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