[release-2.9.x] Pin chunk
and index
format to schema
version.
#10333
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport bbfb13c from #10213
We pin all three
Chunk
,HeadBlock
andTSDB
Version toschema
version in period config.This is the following mapping (after being discussed with @owen-d and @sandeepsukhani )
v12
(current existing schema) - ChunkFormatV3 (UnorderedHeadBlock) + TSDBv2v13
(introducing new schema) - ChunkFormatV4 (UnorderedWithNonIndexedLabelsHeadBlockFmt) + TSDBv3Note the new schema
v13
supports the latest chunk and index format.NOTES for Reviewer
General approach is we removed the idea of
index.LiveFormat
,chunkenc.DefaultChunkFormat
andchunkenc.DefaultHeadBlockFmt
and made following two changes. These variables were used before to tie chunk and tsdb formats specific to Loki versions. This PR remove that coupling and pin these formats toschema
version instead.schema
config.Add two methods to
periodConfig
. (1)ChunkFormat()
returning chunk and head format tied to schema (2)TSDBFormat()
returning tsdb format tied to schema.Other ideas I thought of doing but didn't end up doing is make
ChunkFormat
andIndexFormat
as separate type (rather thanbyte
andint
currently. Similar toHeadBlockFmt
type). But didnt' do it eventually to keep the PR small and don't want to complicate with lots of changes.Moved couple of test cases from
chunkenc
toconfig
package, because the test case was actually testing methods onschemaconfig
and it was creating cycling dependencies.