From 4670829502e01ac1e3be0ae05062f2fd862a83aa Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Thu, 22 Sep 2022 18:00:33 +0300 Subject: [PATCH] db/large_data_handler: separate pk and ck strings in log warning with delimiter Currently (since f3089bf3d1eda2be01e3af07fe1fde6fb08b62d5), when printing a warning to the log about large rows and/or cells the clustering key string is concatenated to the partition key string, rendering the warning confsing and much less useful. This patch adds a '/' delimiter to separate the fields, and also uses one to separate the clustering key from the column name for large cells. In case of a static cell, the clustering key is null hence the warning will look like: `pk//column`. This patch does NOT change anything in the large_* system table schema or contents. It changes only the log warning format that need not be backward compatible. Fixes #11620 Signed-off-by: Benny Halevy --- db/large_data_handler.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/large_data_handler.cc b/db/large_data_handler.cc index 3a79e46ba3..97d02b15e5 100644 --- a/db/large_data_handler.cc +++ b/db/large_data_handler.cc @@ -146,9 +146,9 @@ future<> cql_table_large_data_handler::record_large_cells(const sstables::sstabl if (clustering_key) { const schema &s = *sst.get_schema(); auto ck_str = key_to_str(*clustering_key, s); - return try_record("cell", sst, partition_key, int64_t(cell_size), cell_type, format("{} {}", ck_str, column_name), extra_fields, ck_str, column_name); + return try_record("cell", sst, partition_key, int64_t(cell_size), cell_type, format("/{}/{}", ck_str, column_name), extra_fields, ck_str, column_name); } else { - return try_record("cell", sst, partition_key, int64_t(cell_size), cell_type, column_name, extra_fields, data_value::make_null(utf8_type), column_name); + return try_record("cell", sst, partition_key, int64_t(cell_size), cell_type, format("//{}", column_name), extra_fields, data_value::make_null(utf8_type), column_name); } } @@ -158,7 +158,7 @@ future<> cql_table_large_data_handler::record_large_rows(const sstables::sstable if (clustering_key) { const schema &s = *sst.get_schema(); std::string ck_str = key_to_str(*clustering_key, s); - return try_record("row", sst, partition_key, int64_t(row_size), "row", ck_str, extra_fields, ck_str); + return try_record("row", sst, partition_key, int64_t(row_size), "row", format("/{}", ck_str), extra_fields, ck_str); } else { return try_record("row", sst, partition_key, int64_t(row_size), "static row", "", extra_fields, data_value::make_null(utf8_type)); }