fix: correct content address lookup while indexes rebalancing
@@ -480,8 +480,9 @@ public final class CellBTreeSingleValueBucketV3<K> extends ODurablePage {
final int entryPosition =
getIntValue(POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE);
- final int keySize = getObjectSizeInDirectMemory(keySerializer, entryPosition);
-
+ final int keySize =
+ getObjectSizeInDirectMemory(keySerializer, entryPosition + 2 * OIntegerSerializer.INT_SIZE);
+ assert entryPosition + keySize < MAX_PAGE_SIZE_BYTES;
if (key.length == keySize) {
setBinaryValue(entryPosition + 2 * OIntegerSerializer.INT_SIZE, key);
return true;
@@ -534,7 +535,7 @@ public final class CellBTreeSingleValueBucketV3<K> extends ODurablePage {
public void updateValue(final int index, final byte[] value, final int keySize) {
final int entryPosition =
- getIntValue(index * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET) + keySize;
+ getIntValue(index * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET);
setBinaryValue(entryPosition, value);
}
