diff --git a/tddb/td/db/binlog/BinlogEvent.h b/tddb/td/db/binlog/BinlogEvent.h index 1874543d..5a8bff44 100644 --- a/tddb/td/db/binlog/BinlogEvent.h +++ b/tddb/td/db/binlog/BinlogEvent.h @@ -80,6 +80,10 @@ struct BinlogEvent { Status init(BufferSlice &&raw_event, bool check_crc = true) TD_WARN_UNUSED_RESULT; static BufferSlice create_raw(uint64 id, int32 type, int32 flags, const Storer &storer); + std::string public_to_string() { + return PSTRING() << "LogEvent[" << tag("id", format::as_hex(id_)) << tag("type", type_) << tag("flags", flags_) + << tag("data", data_.size()) << "]"; + } }; inline StringBuilder &operator<<(StringBuilder &sb, const BinlogEvent &event) { diff --git a/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp b/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp index ce769998..1eb23fe2 100644 --- a/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp +++ b/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp @@ -18,7 +18,7 @@ void BinlogEventsProcessor::do_event(BinlogEvent &&event) { if ((event.flags_ & BinlogEvent::Flags::Rewrite) && !ids_.empty() && ids_.back() >= fixed_id) { auto it = std::lower_bound(ids_.begin(), ids_.end(), fixed_id); if (it == ids_.end() || *it != fixed_id) { - LOG(FATAL) << "Ignore rewrite logevent"; + LOG(FATAL) << "Ignore rewrite logevent " << event.public_to_string(); return; } auto pos = it - ids_.begin();