mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
db/commitlog: Extend error messages for corrupted data
We're providing additional information in error messages when throwing
an exception related to data corruption: when a segment is truncated
and when it's content is invalid. That might prove helpful when debugging.
Closes scylladb/scylladb#25190
(cherry picked from commit 408b45fa7e)
Closes scylladb/scylladb#25459
This commit is contained in:
committed by
Pavel Emelyanov
parent
38f4c3325d
commit
69307eaf2d
@@ -392,9 +392,7 @@ public:
|
||||
class segment_data_corruption_error: public segment_error {
|
||||
std::string _msg;
|
||||
public:
|
||||
segment_data_corruption_error(std::string msg, uint64_t s)
|
||||
: _msg(std::move(msg)), _bytes(s) {
|
||||
}
|
||||
segment_data_corruption_error(std::string_view msg, uint64_t s);
|
||||
uint64_t bytes() const {
|
||||
return _bytes;
|
||||
}
|
||||
@@ -425,7 +423,7 @@ public:
|
||||
std::string _msg;
|
||||
uint64_t _pos;
|
||||
public:
|
||||
segment_truncation(uint64_t);
|
||||
segment_truncation(std::string_view reason, uint64_t position);
|
||||
|
||||
uint64_t position() const;
|
||||
const char* what() const noexcept override;
|
||||
|
||||
Reference in New Issue
Block a user