diff options
author | Jon Bailey <Jonathan.bailey1@ibm.com> | 2025-01-09 17:19:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 17:19:54 +0100 |
commit | 3383af5dd1a1057baa1dfaae2840b68a35ac9265 (patch) | |
tree | 75c5c5823af8294e21d06793e1cd7bc09efb9478 /src/common/io_exerciser/EcIoSequence.h | |
parent | Merge pull request #52791 from clwluvw/location-constraint (diff) | |
parent | common/io_exerciser: Make chunksize so initial generated value is 4096 and ra... (diff) | |
download | ceph-3383af5dd1a1057baa1dfaae2840b68a35ac9265.tar.xz ceph-3383af5dd1a1057baa1dfaae2840b68a35ac9265.zip |
Merge pull request #60330 from JonBailey1993/JonBailey1993/ceph_test_rados_io_sequence_inject_error
common/io_exerciser: Add support to ceph_test_rados_io_sequence injecting errors for testing how erasure coding deals with error scenarios
Reviewed-by: Ronen Friedman <rfriedma@ibm.com>
Diffstat (limited to 'src/common/io_exerciser/EcIoSequence.h')
-rw-r--r-- | src/common/io_exerciser/EcIoSequence.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/common/io_exerciser/EcIoSequence.h b/src/common/io_exerciser/EcIoSequence.h new file mode 100644 index 00000000000..37283b3906b --- /dev/null +++ b/src/common/io_exerciser/EcIoSequence.h @@ -0,0 +1,65 @@ +#include "IoSequence.h" + +namespace ceph { +namespace io_exerciser { +class EcIoSequence : public IoSequence { + public: + virtual bool is_supported(Sequence sequence) const override; + static std::unique_ptr<IoSequence> generate_sequence( + Sequence s, std::pair<int, int> obj_size_range, int k, int m, int seed); + + protected: + bool setup_inject; + bool clear_inject; + std::optional<uint64_t> shard_to_inject; + InjectOpType inject_op_type; + + EcIoSequence(std::pair<int, int> obj_size_range, int seed); + + // Writes cannot be sent to injected on shard zero, so selections seperated + // out + void select_random_data_shard_to_inject_read_error(int k, int m); + void select_random_data_shard_to_inject_write_error(int k, int m); + void select_random_shard_to_inject_read_error(int k, int m); + void select_random_shard_to_inject_write_error(int k, int m); + void generate_random_read_inject_type(); + void generate_random_write_inject_type(); +}; + +class ReadInjectSequence : public EcIoSequence { + public: + ReadInjectSequence(std::pair<int, int> obj_size_range, int seed, Sequence s, + int k, int m); + + Sequence get_id() const override; + std::string get_name() const override; + virtual std::unique_ptr<IoOp> next() override; + std::unique_ptr<IoOp> _next() override; + + private: + std::unique_ptr<IoSequence> child_sequence; + std::unique_ptr<IoOp> nextOp; +}; + +class Seq10 : public EcIoSequence { + public: + Seq10(std::pair<int, int> obj_size_range, int seed, int k, int m); + + Sequence get_id() const override; + std::string get_name() const override; + std::unique_ptr<IoOp> _next() override; + + private: + uint64_t offset; + uint64_t length; + + bool inject_error_done; + bool failed_write_done; + bool read_done; + bool clear_inject_done; + bool successful_write_done; + bool test_all_lengths; + bool test_all_sizes; +}; +} // namespace io_exerciser +} // namespace ceph
\ No newline at end of file |