Skip to content

Commit

Permalink
fix: parse timestamp from the name of data dir for gc instead of the …
Browse files Browse the repository at this point in the history
…last update time
  • Loading branch information
empiredan committed Nov 6, 2023
1 parent c3d0fea commit f3f9abb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/replica/disk_cleaner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ bool get_expiration_timestamp_by_last_write_time(const std::string &path,
return true;
}

// Unix timestamp in microseconds for 2010-01-01 00:00:00.
// Unix timestamp in microseconds for 2010-01-01 00:00:00 GMT+0000.
// This timestamp could be used as the minimum, since it's far earlier than the time when
// Pegasus was born.
#define MIN_TIMESTAMP_US 1262275200000000
#define MIN_TIMESTAMP_US 1262304000000000
#define MIN_TIMESTAMP_US_LENGTH (sizeof(STRINGIFY(MIN_TIMESTAMP_US)) - 1)

// Parse timestamp from the directory name.
Expand All @@ -112,9 +112,9 @@ bool get_expiration_timestamp_by_last_write_time(const std::string &path,
// Specify the size of suffix by `suffix_size`. For both kinds of names (.err and .gar),
// `suffix_size` is 4.
//
// The timestamp is the number the number just before the suffix, between the 2 dots. For
// example, in 1.1.pegasus.1698843209235962.err, 1698843209235962 is the timestamp, in
// microseconds, generated by dsn_now_us().
// The timestamp is the number just before the suffix, between the 2 dots. For example, in
// 1.1.pegasus.1698843209235962.err, 1698843209235962 is the timestamp in microseconds,
// generated by dsn_now_us().
//
// `timestamp_us` is parsed result while returning true; otherwise, it would never be assigned.
bool parse_timestamp_us(const std::string &name, size_t suffix_size, uint64_t &timestamp_us)
Expand Down

0 comments on commit f3f9abb

Please sign in to comment.