scylladb / cql-stress

10 stars 4 forks source link

mixed: prepare statements only for subcommands defined by user #96

Closed muzarski closed 3 months ago

muzarski commented 3 months ago

Motivation

See the discussion: https://github.com/scylladb/cql-stress/pull/86#issuecomment-2204524664.

My last PR (https://github.com/scylladb/cql-stress/pull/86) introduced a new bug - mixed command tries to prepare a statement for each operation (read/write/counter_read/counter_write), even though it does not create the tables.

This PR fixes it so we prepare the statements only for the operations that are going to be sampled (were specified in ratio() parameter by the user). We obviously then assume that the corresponding write workload was ran beforehand and that it created tables used by the mixed workload.

fruch commented 3 months ago

I've took the PR into SCT integration test, and mixed is working as expected (i.e. doesn't fail)

muzarski commented 3 months ago

v2:

muzarski commented 3 months ago

v2.1: In previous comment I mentioned that we don't need PartialEq + Eq trait bounds to implement sampling methods. I forgot to remove them, tho...