-
Notifications
You must be signed in to change notification settings - Fork 544
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
Replace TenantIndex, BlockMeta and CompactedBlockMeta with proto near-equivalents #4072
Conversation
513e33b
to
3c10c0f
Compare
f65adc7
to
cc764f5
Compare
5d44486
to
c89cb07
Compare
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.
I like where we ended up with this PR. The existing block meta.json and block state are unchanged, but we will get the index proto efficiency on the downstream components (frontend, querier). This PR looks like a lot, but 90% is fallout from the uuid and Size changes. The actual change is much smaller. 99% LGTM left a few q's and comments.
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.
Great work! Let's get the changelog entry and then merge.
4cdb387
to
89c0a71
Compare
What this PR does:
Here we replace the
TenantIndex
,BlockMeta
andCompactedBlockMeta
with structs which are generated from proto. This allows us to convert theTenantIndex
to proto-only without the translation between a backend struct and an internal struct, since the internal structs here are being replaced. TheBlockMeta
andCompactedBlockMeta
remainjson
. We may consider replacing these with proto in the future.The replacement structs are not identical. Of note, the
BlockMeta
struct has several fields which have no proto equivalent. In order to overcome this, several types have been defined in the proto asbytes
, which allows the use of thecustomtype
gogo proto option to point to a specific type. Those types must conform to a specific interface, and so methods have been added where necessary.backend.DedicatedColumns
updated to include proto marshal and unmarshal methodsbackend.Encoding
updated to include prto marshal and unmarshal methodsbackend.BlockMeta
has a few type changesTotalObjects
changesint
->int64
Size
becomes a funcion and the old size is moved toSize_
CompactionLevel
changesuint8
->uint32
BloomShardCount
changesuint16
->uint32
ReplicationFactor
changesuint8
->uint32
A new UUID type has been added which is backed by the google UUID type and provide
the necessary interface for use with proto.
The
TenantIndex
is written both as proto and json, and read as protofirst with a fallback to json on error.The
BlockMeta
andCompactedBlockMeta
are written/read only as json.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]