Print unknown writebatch tag (#13062)

Summary:
Add additional info for debugging purpose by doing the same as what WBWI does

632746bb5b/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
This commit is contained in:
Jay Huh 2024-10-10 15:34:35 -07:00 committed by Facebook GitHub Bot
parent 632746bb5b
commit fe6c8cb1d6

View file

@ -502,7 +502,9 @@ Status ReadRecordFromWriteBatch(Slice* input, char* tag,
break; break;
} }
default: default:
return Status::Corruption("unknown WriteBatch tag"); return Status::Corruption(
"unknown WriteBatch tag",
std::to_string(static_cast<unsigned int>(*tag)));
} }
return Status::OK(); return Status::OK();
} }
@ -750,7 +752,9 @@ Status WriteBatchInternal::Iterate(const WriteBatch* wb,
} }
break; break;
default: default:
return Status::Corruption("unknown WriteBatch tag"); return Status::Corruption(
"unknown WriteBatch tag",
std::to_string(static_cast<unsigned int>(tag)));
} }
} }
if (!s.ok()) { if (!s.ok()) {