diff --git a/db/system_keyspace.cc b/db/system_keyspace.cc index 42f99ac77f..ad61fde923 100644 --- a/db/system_keyspace.cc +++ b/db/system_keyspace.cc @@ -3347,11 +3347,11 @@ mutation system_keyspace::make_group0_history_state_id_mutation( using namespace std::chrono; assert(*gc_older_than >= gc_clock::duration{0}); - auto ts_millis = duration_cast(microseconds{ts}); - auto gc_older_than_millis = duration_cast(*gc_older_than); - assert(gc_older_than_millis < ts_millis); + auto ts_micros = microseconds{ts}; + auto gc_older_than_micros = duration_cast(*gc_older_than); + assert(gc_older_than_micros < ts_micros); - auto tomb_upper_bound = utils::UUID_gen::min_time_UUID(ts_millis - gc_older_than_millis); + auto tomb_upper_bound = utils::UUID_gen::min_time_UUID(ts_micros - gc_older_than_micros); // We want to delete all entries with IDs smaller than `tomb_upper_bound` // but the deleted range is of the form (x, +inf) since the schema is reversed. auto range = query::clustering_range::make_starting_with({ diff --git a/utils/UUID_gen.hh b/utils/UUID_gen.hh index d2a69d1e6f..9f032e7620 100644 --- a/utils/UUID_gen.hh +++ b/utils/UUID_gen.hh @@ -289,7 +289,7 @@ public: * Warning: this method should only be used for querying as this * doesn't at all guarantee the uniqueness of the resulting UUID. */ - static UUID min_time_UUID(milliseconds timestamp = milliseconds{0}) + static UUID min_time_UUID(decimicroseconds timestamp = decimicroseconds{0}) { auto uuid = UUID(create_time(from_unix_timestamp(timestamp)), MIN_CLOCK_SEQ_AND_NODE); assert(uuid.is_timestamp());