Use 32bit number for index cache init so Thanos will build on 32bit OS #2218
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.
Changes
Previously the index cache was initialized with
math.MaxInt64
however this will cause Thanos to fail to compile for a 32bit system (Raspberry Pi), It seems a reasonable compromise here is to init the cache withmath.MaxInt32
which addresses the issue. This does however change the cache to hold 2^32 objects vs 2^64, though I think this should still be plenty??Another alternative would be something like this:
However this kind of feels worse to me unless there is an expectation to have more than ~4billion entries in this cache?
Relevant Go issue: golang/go#23086
Signed-off-by: Edward Welch edward.welch@grafana.com