From 4fdb1a5c63c08fc7d9338be181d89d4edc307901 Mon Sep 17 00:00:00 2001 From: Shahar Mike Date: Thu, 11 Jul 2024 09:53:01 +0300 Subject: [PATCH] chore: On invalid TTL, print the TTL first (#3306) Before this change we first printed the value, which could be long resulting in the TTL not appearing in the log due to max line length If the TTL is invalid, we should print it first to see what value it has --- src/server/rdb_load.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/rdb_load.cc b/src/server/rdb_load.cc index 40501019dacb..c03062f84b3d 100644 --- a/src/server/rdb_load.cc +++ b/src/server/rdb_load.cc @@ -647,8 +647,8 @@ void RdbLoaderBase::OpaqueObjLoader::CreateHMap(const LoadTrace* ltrace) { int64_t ttl_time = -1; string_view ttl_str = ToSV(seg[i + 2].rdb_var); if (!absl::SimpleAtoi(ttl_str, &ttl_time)) { - LOG(ERROR) << "Can't parse hashmap TTL for " << key << ", val=" << val - << ", ttl=" << ttl_str; + LOG(ERROR) << "Can't parse hashmap TTL for " << key << ", ttl='" << ttl_str + << "', val=" << val; ec_ = RdbError(errc::rdb_file_corrupted); return; }