Skip to content

Commit

Permalink
chore: On invalid TTL, print the TTL first (#3306)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chakaz authored Jul 11, 2024
1 parent bdf417c commit 4fdb1a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/rdb_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4fdb1a5

Please sign in to comment.