metadata_type: add Serialization type
Ignore it while reading sstable 3_x and throw if it's present when reading 2_x. Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
#include "integrity_checked_file_impl.hh"
|
||||
#include "service/storage_service.hh"
|
||||
#include "db/extensions.hh"
|
||||
#include "unimplemented.hh"
|
||||
|
||||
thread_local disk_error_signal_type sstable_read_error;
|
||||
thread_local disk_error_signal_type sstable_write_error;
|
||||
@@ -750,6 +751,15 @@ future<> parse(sstable_version_types v, random_access_reader& in, statistics& s)
|
||||
return parse<compaction_metadata>(v, in, s.contents[val.first]);
|
||||
case metadata_type::Stats:
|
||||
return parse<stats_metadata>(v, in, s.contents[val.first]);
|
||||
case metadata_type::Serialization:
|
||||
if (v != sstable_version_types::mc) {
|
||||
throw std::runtime_error(
|
||||
"Statistics is malformed: SSTable is in 2.x format but contains serialization header.");
|
||||
} else {
|
||||
// Ignore
|
||||
warn(unimplemented::cause::SSTABLE_FORMAT_M);
|
||||
}
|
||||
return make_ready_future<>();
|
||||
default:
|
||||
sstlog.warn("Invalid metadata type at Statistics file: {} ", int(val.first));
|
||||
return make_ready_future<>();
|
||||
|
||||
@@ -388,6 +388,7 @@ enum class metadata_type : uint32_t {
|
||||
Validation = 0,
|
||||
Compaction = 1,
|
||||
Stats = 2,
|
||||
Serialization = 3,
|
||||
};
|
||||
|
||||
enum class scylla_metadata_type : uint32_t {
|
||||
|
||||
@@ -61,6 +61,7 @@ std::ostream& operator<<(std::ostream& out, cause c) {
|
||||
case cause::API: return out << "API";
|
||||
case cause::SCHEMA_CHANGE: return out << "SCHEMA_CHANGE";
|
||||
case cause::MIXED_CF: return out << "MIXED_CF";
|
||||
case cause::SSTABLE_FORMAT_M: return out << "SSTABLE_FORMAT_M";
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ enum class cause {
|
||||
STORAGE_SERVICE,
|
||||
SCHEMA_CHANGE,
|
||||
MIXED_CF,
|
||||
SSTABLE_FORMAT_M,
|
||||
};
|
||||
|
||||
[[noreturn]] void fail(cause what);
|
||||
|
||||
Reference in New Issue
Block a user