Binlog: even more debug
GitOrigin-RevId: 99585d14e3446dc1f5c4a4a7c1ba1e2b3aeef47e
This commit is contained in:
parent
b301a35fce
commit
7fa145c33e
@ -158,7 +158,7 @@ class BinlogKeyValue : public KeyValueSyncInterface {
|
||||
}
|
||||
|
||||
void add_event(uint64 seq_no, BufferSlice &&event) {
|
||||
binlog_->add_raw_event(seq_no, std::move(event));
|
||||
binlog_->add_raw_event(BinlogDebugInfo{__FILE__, __LINE__}, seq_no, std::move(event));
|
||||
}
|
||||
|
||||
bool isset(const string &key) override {
|
||||
@ -237,7 +237,7 @@ class BinlogKeyValue : public KeyValueSyncInterface {
|
||||
};
|
||||
template <>
|
||||
inline void BinlogKeyValue<Binlog>::add_event(uint64 seq_no, BufferSlice &&event) {
|
||||
binlog_->add_raw_event(std::move(event));
|
||||
binlog_->add_raw_event(std::move(event), BinlogDebugInfo{__FILE__, __LINE__});
|
||||
}
|
||||
template <>
|
||||
inline void BinlogKeyValue<Binlog>::force_sync(Promise<> &&promise) {
|
||||
|
@ -125,6 +125,7 @@ class BinlogReader {
|
||||
return size_;
|
||||
}
|
||||
|
||||
event->debug_info_ = BinlogDebugInfo{__FILE__, __LINE__};
|
||||
TRY_STATUS(event->init(input_->cut_head(size_).move_as_buffer_slice()));
|
||||
offset_ += size_;
|
||||
event->offset_ = offset_;
|
||||
@ -557,7 +558,8 @@ void Binlog::reset_encryption() {
|
||||
event.key_hash_ = event.generate_hash(key.as_slice());
|
||||
|
||||
do_event(BinlogEvent(
|
||||
BinlogEvent::create_raw(0, BinlogEvent::ServiceTypes::AesCtrEncryption, 0, create_default_storer(event))));
|
||||
BinlogEvent::create_raw(0, BinlogEvent::ServiceTypes::AesCtrEncryption, 0, create_default_storer(event)),
|
||||
BinlogDebugInfo{__FILE__, __LINE__}));
|
||||
}
|
||||
|
||||
void Binlog::do_reindex() {
|
||||
|
@ -67,9 +67,9 @@ class Binlog {
|
||||
return fd_.empty();
|
||||
}
|
||||
|
||||
void add_raw_event(BufferSlice &&raw_event) {
|
||||
add_event(BinlogEvent(std::move(raw_event)));
|
||||
}
|
||||
//void add_raw_event(BufferSlice &&raw_event) {
|
||||
//add_event(BinlogEvent(std::move(raw_event)));
|
||||
//}
|
||||
|
||||
void add_raw_event(BufferSlice &&raw_event, BinlogDebugInfo info) {
|
||||
add_event(BinlogEvent(std::move(raw_event), info));
|
||||
|
@ -14,7 +14,7 @@ int32 VERBOSITY_NAME(binlog) = VERBOSITY_NAME(DEBUG) + 8;
|
||||
Status BinlogEvent::init(BufferSlice &&raw_event, bool check_crc) {
|
||||
TlParser parser(raw_event.as_slice());
|
||||
size_ = parser.fetch_int();
|
||||
CHECK(size_ == raw_event.size()) << size_ << " " << raw_event.size();
|
||||
CHECK(size_ == raw_event.size()) << size_ << " " << raw_event.size() << debug_info_;
|
||||
id_ = parser.fetch_long();
|
||||
type_ = parser.fetch_int();
|
||||
flags_ = parser.fetch_int();
|
||||
|
@ -81,6 +81,7 @@ struct BinlogEvent {
|
||||
}
|
||||
BinlogEvent clone() const {
|
||||
BinlogEvent result;
|
||||
result.debug_info_ = BinlogDebugInfo{__FILE__, __LINE__};
|
||||
result.init(raw_event_.clone()).ensure();
|
||||
return result;
|
||||
}
|
||||
@ -90,13 +91,14 @@ struct BinlogEvent {
|
||||
}
|
||||
|
||||
BinlogEvent() = default;
|
||||
explicit BinlogEvent(BufferSlice &&raw_event) {
|
||||
init(std::move(raw_event), false).ensure();
|
||||
}
|
||||
//explicit BinlogEvent(BufferSlice &&raw_event) {
|
||||
//init(std::move(raw_event), false).ensure();
|
||||
//}
|
||||
explicit BinlogEvent(BufferSlice &&raw_event, BinlogDebugInfo info) {
|
||||
init(std::move(raw_event), false).ensure();
|
||||
debug_info_ = info;
|
||||
init(std::move(raw_event), false).ensure();
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -23,7 +23,8 @@ class BinlogEventsBuffer {
|
||||
auto &event = events_[i];
|
||||
if (i + 1 != ids_.size() && (event.flags_ & BinlogEvent::Flags::Partial) == 0) {
|
||||
callback(BinlogEvent(BinlogEvent::create_raw(event.id_, event.type_, event.flags_ | BinlogEvent::Flags::Partial,
|
||||
create_storer(event.data_))));
|
||||
create_storer(event.data_)),
|
||||
BinlogDebugInfo{__FILE__, __LINE__}));
|
||||
} else {
|
||||
callback(std::move(event));
|
||||
}
|
||||
|
Reference in New Issue
Block a user