mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 21:47:10 +00:00
table: get_truncation_time: check _truncated_at is initialized
This commit is contained in:
@@ -502,7 +502,7 @@ private:
|
||||
|
||||
// This field cashes the last truncation time for the table.
|
||||
// The master resides in system.truncated table
|
||||
db_clock::time_point _truncated_at = db_clock::time_point::min();
|
||||
std::optional<db_clock::time_point> _truncated_at;
|
||||
|
||||
bool _is_bootstrap_or_replace = false;
|
||||
sstables::shared_sstable make_sstable(sstables::sstable_state state);
|
||||
@@ -520,9 +520,7 @@ public:
|
||||
void set_truncation_time(db_clock::time_point truncated_at) noexcept {
|
||||
_truncated_at = truncated_at;
|
||||
}
|
||||
db_clock::time_point get_truncation_time() const noexcept {
|
||||
return _truncated_at;
|
||||
}
|
||||
db_clock::time_point get_truncation_time() const;
|
||||
|
||||
void notify_bootstrap_or_replace_start();
|
||||
|
||||
|
||||
@@ -439,6 +439,14 @@ sstables::shared_sstable table::make_sstable() {
|
||||
return make_sstable(sstables::sstable_state::normal);
|
||||
}
|
||||
|
||||
db_clock::time_point table::get_truncation_time() const {
|
||||
if (!_truncated_at) [[unlikely]] {
|
||||
on_internal_error(dblog, ::format("truncation time is not set, table {}.{}",
|
||||
_schema->ks_name(), _schema->cf_name()));
|
||||
}
|
||||
return *_truncated_at;
|
||||
}
|
||||
|
||||
void table::notify_bootstrap_or_replace_start() {
|
||||
_is_bootstrap_or_replace = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user