-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Introduce large block doc values format #138182
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
Introduce large block doc values format #138182
Conversation
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
...c/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBLargeBlockDocValuesFormat.java
Outdated
Show resolved
Hide resolved
...t/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBLargeBlockDocValuesFormatTests.java
Outdated
Show resolved
Hide resolved
…into tsdb/codec-refactor-block-size
# Conflicts: # server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesConsumer.java # server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesFormat.java
…into tsdb/codec-refactor-block-size
# Conflicts: # server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesFormat.java
martijnvg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kostas! This looks good. I left a few minor comments.
server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesFormat.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| public static int randomNumericBlockSize() { | ||
| return random().nextBoolean() ? ES819TSDBDocValuesFormat.NUMERIC_LARGE_BLOCK_SHIFT : ES819TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's test with more blockshifts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an assert to check that only these two values are allowed. We can add more as needed.
server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java
Show resolved
Hide resolved
|
|
||
| // read in the entries from the metadata file. | ||
| int version = -1; | ||
| int blockShift = numericBlockShift; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should numericBlockShift always be ES819TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! No need to pass the arg, indeed.
martijnvg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Introduces a new version of the existing tsdb doc values format that allows configuring the block size, adding 512 to the existing size of 128. The block size is included it codec metadata, so that blocks written with the larger setting will be read with this as well. This provides flexibility for configuring tsdb and logsdb indices differently, using the same codec version.
While this change bumps up the version, it should still be a no-op (other than writing and reading the block size to the metadata). The larger block size will be wired for use in tsdb indices in a follow-up change.
Related to #136307