Current test and test step are now updated when the step changes.
Fixes: https://tracker.ceph.com/issues/73534
Signed-off-by: Matty Williams <Matty.Williams@ibm.com>
bool DataGenerator::validate(bufferlist& bufferlist, uint64_t offset,
uint64_t length, std::string_view pool,
- ceph::io_exerciser::Sequence curseq,
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq) {
+ ceph::io_exerciser::Sequence curseq, int step) {
return bufferlist.contents_equal(generate_data(offset, length));
}
bool HeaderedSeededRandomGenerator::validate(bufferlist& bufferlist, uint64_t offset,
uint64_t length, std::string_view pool,
ceph::io_exerciser::Sequence curseq,
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq) {
+ int step) {
std::vector<uint64_t> invalid_block_offsets;
for (uint64_t block_offset = offset; block_offset < offset + length;
}
if (!invalid_block_offsets.empty()) {
- dout(0) << "Miscompare for read of " << m_model.get_primary_oid() <<
- " offset=" << offset << " length=" << length << " in pool " << pool <<
- ". This occured in test " << curseq << " step " << seq->get_step() << dendl;
+ dout(0) << "Miscompare for read of oid=" << m_model.get_primary_oid() <<
+ " offset=" << offset << " length=" << length << " pool=" << pool <<
+ ". This occured in test=" << curseq << " step=" << step << dendl;
printDebugInformationForOffsets(offset, invalid_block_offsets, bufferlist);
}
virtual bufferlist generate_data(uint64_t length, uint64_t offset) = 0;
virtual bool validate(bufferlist& bufferlist, uint64_t offset,
uint64_t length, std::string_view pool,
- ceph::io_exerciser::Sequence curseq,
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq);
+ ceph::io_exerciser::Sequence curseq, int step);
// Used for testing debug outputs from data generation
virtual bufferlist generate_wrong_data(uint64_t offset, uint64_t length);
bufferptr generate_block(uint64_t offset) override;
bufferptr generate_wrong_block(uint64_t offset) override;
bool validate(bufferlist& bufferlist, uint64_t offset,
- uint64_t length, std::string_view pool, ceph::io_exerciser::Sequence curseq,
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq) override;
+ uint64_t length, std::string_view pool,
+ ceph::io_exerciser::Sequence curseq, int step) override;
private:
using UniqueIdBytes = uint64_t;
const uint64_t Model::get_block_size() const { return block_size; }
int Model::get_num_io() const { return num_io; }
+
+void Model::set_test_step(ceph::io_exerciser::Sequence new_seq, int new_step) {
+ curseq = new_seq;
+ step = new_step;
+}
#include <boost/asio/io_context.hpp>
#include "IoOp.h"
+#include "common/io_exerciser/IoSequence.h"
#include "common/Thread.h"
#include "global/global_context.h"
#include "global/global_init.h"
std::string primary_oid;
std::string secondary_oid;
uint64_t block_size;
+ ceph::io_exerciser::Sequence curseq;
+ int step;
bool delete_objects;
int num_objects{0};
+ void set_primary_oid(const std::string& new_oid);
+ void set_secondary_oid(const std::string& new_oid);
+
public:
Model(const std::string& primary_oid, const std::string& secondary_oid,
uint64_t block_size, bool delete_objects);
virtual bool readyForIoOp(IoOp& op) = 0;
virtual void applyIoOp(IoOp& op) = 0;
+ void set_test_step(ceph::io_exerciser::Sequence new_seq, int new_step);
virtual void set_primary_oid(const std::string& new_oid);
virtual void set_secondary_oid(const std::string& new_oid);
const std::string& pool, const std::string& primary_oid, const std::string& secondary_oid,
uint64_t block_size, int seed, int threads, ceph::mutex& lock,
ceph::condition_variable& cond, bool is_replicated_pool,
- bool ec_optimizations, ceph::io_exerciser::Sequence curseq,
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq, bool delete_objects)
+ bool ec_optimizations, bool delete_objects)
: Model(primary_oid, secondary_oid, block_size, delete_objects),
rados(rados),
asio(asio),
threads(threads),
lock(lock),
cond(cond),
- outstanding_io(0),
- curseq(curseq),
- seq(seq) {
+ outstanding_io(0) {
int rc;
rc = rados.ioctx_create(pool.c_str(), io);
ceph_assert(rc == 0);
ceph_assert(ec == boost::system::errc::success);
for (int i = 0; i < N; i++) {
ceph_assert(db->validate(op_info->bufferlist[i], op_info->offset[i],
- op_info->length[i], pool, curseq, seq));
+ op_info->length[i], pool, curseq, step));
}
finish_io();
};
ceph::condition_variable& cond;
librados::IoCtx io;
int outstanding_io;
- ceph::io_exerciser::Sequence curseq;
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq;
void start_io();
void finish_io();
const std::string& pool, const std::string& primary_oid, const std::string& secondary_oid,
uint64_t block_size, int seed, int threads, ceph::mutex& lock,
ceph::condition_variable& cond, bool is_replicated_pool,
- bool ec_optimizations, ceph::io_exerciser::Sequence curseq,
- std::unique_ptr<ceph::io_exerciser::IoSequence> seq, bool delete_objects = true);
+ bool ec_optimizations, bool delete_objects = true);
~RadosIo();
}
op = seq->next();
+ exerciser_model->set_test_step(curseq, seq->get_step());
done = false;
dout(0) << "== " << exerciser_model->get_primary_oid() << " " << curseq << " "
<< seq->get_name_with_seqseed() << " ==" << dendl;
op = seq->next();
}
}
+ exerciser_model->set_test_step(curseq, seq->get_step());
return done;
}