From: Jay Huh Date: Thu, 10 Oct 2024 22:34:35 +0000 (-0700) Subject: Print unknown writebatch tag (#13062) X-Git-Tag: v9.7.3~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5bb363edc72c31d57abe4c9eace5bb48d0e3bba3;p=rocksdb.git Print unknown writebatch tag (#13062) Summary: Add additional info for debugging purpose by doing the same as what WBWI does https://github.com/facebook/rocksdb/blob/632746bb5b8d9d817b0075b295e1a085e1e543a4/utilities/write_batch_with_index/write_batch_with_index.cc#L274-L276 Pull Request resolved: https://github.com/facebook/rocksdb/pull/13062 Test Plan: CI Reviewed By: hx235 Differential Revision: D64202297 Pulled By: jaykorean fbshipit-source-id: 65164fd88420fc72b6db26d1436afe548a653269 --- diff --git a/db/write_batch.cc b/db/write_batch.cc index 3820dccd0..76b59efb6 100644 --- a/db/write_batch.cc +++ b/db/write_batch.cc @@ -502,7 +502,9 @@ Status ReadRecordFromWriteBatch(Slice* input, char* tag, break; } default: - return Status::Corruption("unknown WriteBatch tag"); + return Status::Corruption( + "unknown WriteBatch tag", + std::to_string(static_cast(*tag))); } return Status::OK(); } @@ -750,7 +752,9 @@ Status WriteBatchInternal::Iterate(const WriteBatch* wb, } break; default: - return Status::Corruption("unknown WriteBatch tag"); + return Status::Corruption( + "unknown WriteBatch tag", + std::to_string(static_cast(tag))); } } if (!s.ok()) {