Skip to content

Commit 7418993

Browse files
committed
fix: change unknown_table_id log level from warning to debug
Unknown table events are expected behavior for databases with multiple tables when only specific tables are being replicated. These should be logged at debug level to reduce log noise in production. Changes: - Modified 3 locations in binlog_event_parser.cpp - Changed event type from mysql_binlog_warning to mysql_binlog_debug - Changed log level from Warn() to Debug() - Affects write_rows, update_rows, and delete_rows event handlers
1 parent 417fc2e commit 7418993

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mysql/binlog_event_parser.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ std::optional<BinlogEvent> BinlogEventParser::ParseBinlogEvent(
201201
const TableMetadata* table_meta = table_metadata_cache.Get(table_id);
202202
if (table_meta == nullptr) {
203203
mygram::utils::StructuredLog()
204-
.Event("mysql_binlog_warning")
204+
.Event("mysql_binlog_debug")
205205
.Field("type", "unknown_table_id")
206206
.Field("event_type", "write_rows")
207207
.Field("table_id", table_id)
208-
.Warn();
208+
.Debug();
209209
return std::nullopt;
210210
}
211211

@@ -289,11 +289,11 @@ std::optional<BinlogEvent> BinlogEventParser::ParseBinlogEvent(
289289
const TableMetadata* table_meta = table_metadata_cache.Get(table_id);
290290
if (table_meta == nullptr) {
291291
mygram::utils::StructuredLog()
292-
.Event("mysql_binlog_warning")
292+
.Event("mysql_binlog_debug")
293293
.Field("type", "unknown_table_id")
294294
.Field("event_type", "update_rows")
295295
.Field("table_id", table_id)
296-
.Warn();
296+
.Debug();
297297
return std::nullopt;
298298
}
299299

@@ -381,11 +381,11 @@ std::optional<BinlogEvent> BinlogEventParser::ParseBinlogEvent(
381381
const TableMetadata* table_meta = table_metadata_cache.Get(table_id);
382382
if (table_meta == nullptr) {
383383
mygram::utils::StructuredLog()
384-
.Event("mysql_binlog_warning")
384+
.Event("mysql_binlog_debug")
385385
.Field("type", "unknown_table_id")
386386
.Field("event_type", "delete_rows")
387387
.Field("table_id", table_id)
388-
.Warn();
388+
.Debug();
389389
return std::nullopt;
390390
}
391391

0 commit comments

Comments
 (0)