mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
Currently, the system.compaction_history table miss precious information like the type of compaction (cleanup, major, resharding, etc) or the sstable generations involved (in and out) used countless times to diagnose issues. Thus, the commit extend the current definition of the table by adding the following columns: + "compaction_type" (text) + "started_at" (int) + "shard_id" (int) + "sstables_in" (list<sstableinfo_type>) + "sstables_out" (list<sstableinfo_type>) + "total_tombstone_purge_attempt" (long) + "total_tombstone_purge_failure_due_to_overlapping_with_memtable" (long) + "total_tombstone_purge_failure_due_to_overlapping_with_uncompacting_sstable" (long) Furthermore, the commit introduces a new feature flag in order to prevent nodes from writing data to new columns when a cluster is not fully upgraded.
41 lines
1015 B
C++
41 lines
1015 B
C++
/*
|
|
* Copyright (C) 2025-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <seastar/core/shard_id.hh>
|
|
#include <seastar/core/sstring.hh>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
#include "sstables/basic_info.hh"
|
|
#include "utils/UUID.hh"
|
|
|
|
namespace db {
|
|
|
|
struct compaction_history_entry {
|
|
utils::UUID id;
|
|
shard_id shard_id;
|
|
sstring ks;
|
|
sstring cf;
|
|
sstring compaction_type;
|
|
int64_t started_at = 0;
|
|
int64_t compacted_at = 0;
|
|
int64_t bytes_in = 0;
|
|
int64_t bytes_out = 0;
|
|
// Key: number of rows merged
|
|
// Value: counter
|
|
std::unordered_map<int32_t, int64_t> rows_merged;
|
|
std::vector<sstables::basic_info> sstables_in;
|
|
std::vector<sstables::basic_info> sstables_out;
|
|
int64_t total_tombstone_purge_attempt = 0;
|
|
int64_t total_tombstone_purge_failure_due_to_overlapping_with_memtable = 0;
|
|
int64_t total_tombstone_purge_failure_due_to_overlapping_with_uncompacting_sstable = 0;
|
|
};
|
|
|
|
}
|