This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3184060fa70 [chore](page) print the file path to the log when 
encountering corruption data pages (#26134)
3184060fa70 is described below

commit 3184060fa70b0d299c5227bece80bd6e88e220bd
Author: xy720 <[email protected]>
AuthorDate: Tue Oct 31 10:17:54 2023 +0800

    [chore](page) print the file path to the log when encountering corruption 
data pages (#26134)
---
 be/src/olap/rowset/segment_v2/page_io.cpp | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/page_io.cpp 
b/be/src/olap/rowset/segment_v2/page_io.cpp
index 30165423724..c712478850a 100644
--- a/be/src/olap/rowset/segment_v2/page_io.cpp
+++ b/be/src/olap/rowset/segment_v2/page_io.cpp
@@ -130,7 +130,8 @@ Status PageIO::read_and_decompress_page(const 
PageReadOptions& opts, PageHandle*
         uint32_t footer_size = decode_fixed32_le((uint8_t*)page_slice.data + 
page_slice.size - 4);
         std::string footer_buf(page_slice.data + page_slice.size - 4 - 
footer_size, footer_size);
         if (!footer->ParseFromString(footer_buf)) {
-            return Status::Corruption("Bad page: invalid footer");
+            return Status::Corruption("Bad page: invalid footer, 
footer_size={}, file={}",
+                                      footer_size, 
opts.file_reader->path().native());
         }
         *body = Slice(page_slice.data, page_slice.size - 4 - footer_size);
         return Status::OK();
@@ -139,7 +140,8 @@ Status PageIO::read_and_decompress_page(const 
PageReadOptions& opts, PageHandle*
     // every page contains 4 bytes footer length and 4 bytes checksum
     const uint32_t page_size = opts.page_pointer.size;
     if (page_size < 8) {
-        return Status::Corruption("Bad page: too small size ({})", page_size);
+        return Status::Corruption("Bad page: too small size ({}), file={}", 
page_size,
+                                  opts.file_reader->path().native());
     }
 
     // hold compressed page at first, reset to decompressed page later
@@ -158,8 +160,9 @@ Status PageIO::read_and_decompress_page(const 
PageReadOptions& opts, PageHandle*
         uint32_t expect = decode_fixed32_le((uint8_t*)page_slice.data + 
page_slice.size - 4);
         uint32_t actual = crc32c::Value(page_slice.data, page_slice.size - 4);
         if (expect != actual) {
-            return Status::Corruption("Bad page: checksum mismatch (actual={} 
vs expect={})",
-                                      actual, expect);
+            return Status::Corruption(
+                    "Bad page: checksum mismatch (actual={} vs expect={}), 
file={}", actual, expect,
+                    opts.file_reader->path().native());
         }
     }
 
@@ -168,13 +171,16 @@ Status PageIO::read_and_decompress_page(const 
PageReadOptions& opts, PageHandle*
     // parse and set footer
     uint32_t footer_size = decode_fixed32_le((uint8_t*)page_slice.data + 
page_slice.size - 4);
     if (!footer->ParseFromArray(page_slice.data + page_slice.size - 4 - 
footer_size, footer_size)) {
-        return Status::Corruption("Bad page: invalid footer");
+        return Status::Corruption("Bad page: invalid footer, footer_size={}, 
file={}", footer_size,
+                                  opts.file_reader->path().native());
     }
 
     uint32_t body_size = page_slice.size - 4 - footer_size;
     if (body_size != footer->uncompressed_size()) { // need decompress body
         if (opts.codec == nullptr) {
-            return Status::Corruption("Bad page: page is compressed but codec 
is NO_COMPRESSION");
+            return Status::Corruption(
+                    "Bad page: page is compressed but codec is NO_COMPRESSION, 
file={}",
+                    opts.file_reader->path().native());
         }
         SCOPED_RAW_TIMER(&opts.stats->decompress_ns);
         std::unique_ptr<DataPage> decompressed_page =
@@ -186,8 +192,9 @@ Status PageIO::read_and_decompress_page(const 
PageReadOptions& opts, PageHandle*
         RETURN_IF_ERROR(opts.codec->decompress(compressed_body, 
&decompressed_body));
         if (decompressed_body.size != footer->uncompressed_size()) {
             return Status::Corruption(
-                    "Bad page: record uncompressed size={} vs real 
decompressed size={}",
-                    footer->uncompressed_size(), decompressed_body.size);
+                    "Bad page: record uncompressed size={} vs real 
decompressed size={}, file={}",
+                    footer->uncompressed_size(), decompressed_body.size,
+                    opts.file_reader->path().native());
         }
         // append footer and footer size
         memcpy(decompressed_body.data + decompressed_body.size, 
page_slice.data + body_size,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to