From f3f9abb90f034228d81086d9cd87299565155a28 Mon Sep 17 00:00:00 2001 From: Dan Wang Date: Mon, 6 Nov 2023 16:56:17 +0800 Subject: [PATCH] fix: parse timestamp from the name of data dir for gc instead of the last update time --- src/replica/disk_cleaner.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/replica/disk_cleaner.cpp b/src/replica/disk_cleaner.cpp index 358015e4c3..cc9ffeb661 100644 --- a/src/replica/disk_cleaner.cpp +++ b/src/replica/disk_cleaner.cpp @@ -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. @@ -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 ×tamp_us)