Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
None
Description
When we were trying to tune the bucket sizes hbase.bucketcache.bucket.sizes according to our workload, we encountered an issue due to the way offset is stored in the bucket entry. We divide the offset into integer base and byte value and it assumes that all bucket offsets will be a multiple of 256 (left shifting by 8). See the code below
long offset() { // Java has no unsigned numbers long o = ((long) offsetBase) & 0xFFFFFFFF; o += (((long) (offset1)) & 0xFF) << 32; return o << 8; } private void setOffset(long value) { assert (value & 0xFF) == 0; value >>= 8; offsetBase = (int) value; offset1 = (byte) (value >> 32); }
This was there to save 3 bytes per BucketEntry instead of using long and when there are no other fields in the Bucket Entry, but now there are lot of fields in the bucket entry , This not documented so we could either document the constraint that it should be a strict 256 bytes multiple of just go away with this constraint.
Attachments
Issue Links
- duplicates
-
HBASE-16993 BucketCache throw java.io.IOException: Invalid HFile block magic when configuring hbase.bucketcache.bucket.sizes
- Resolved