Improve page validity check during database extent load (#16552)
Pages with type 2 (gorilla compression) can be > 4096 bytes in multiples of GORILLA PAGE SIZE
Stelios Fragkakis committed
Dec 6, 2023 at 13:51 UTC
1bad78f37806aeddb9a2b1147360c9dc75b27d8d
1 file changed
+3
-1
database/engine/pdc.c
+3
-1
@@ -998,7 +998,9 @@ static bool epdl_populate_pages_from_extent_data(
998
uncompressed_payload_length = 0;
999
for (i = 0; i < count; ++i) {
1000
size_t page_length = header->descr[i].page_length;
1001
- if(page_length > RRDENG_BLOCK_SIZE) {
1001
+ if (page_length > RRDENG_BLOCK_SIZE && (header->descr[i].type != PAGE_GORILLA_METRICS ||
1002
+ (header->descr[i].type == PAGE_GORILLA_METRICS &&
1003
+ (page_length - RRDENG_BLOCK_SIZE) % GORILLA_BUFFER_SIZE))) {
1004
have_read_error = true;
1005
break;
1006
}