feat: support deterministic load generator values#26174
Merged
Conversation
* simplify FieldValue types by making load generator functions should be generic over RngCore and passing the RNG in to methods rather than depending on it being available on every type instance that needs it * expose influxdb3_load_generator as library crate * export config, spec, and measurement types publicly to suppore use in the antithesis-e2e crate * fix bug that surfaced whenever the cardinality value was less than the lines per sample value by forcing LP lines in a set of samples to be distinct from one another with nanosecond increments
waynr
added a commit
that referenced
this pull request
Mar 21, 2025
feat: support deterministic load generator values (#26174)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the load generator to make it easier to use in a set of end-to-end tests I am writing for an Antithesis PoC. It includes the following changes:
Generator,GeneratorRunner,FieldValue, etc) to support their use in a separate e2e crateGeneratorRunnertype to encapsulate state that was being passed around to multiple methods and simplify usage at the e2e level.FieldValue::Integer(IntegerValue::Sequential(u64))- causes values to be written sequentially for each generated LP line starting from 0FieldValue::String(StringValue::Sequential(Arc<str>, u64))- causes values to be written sequentially for each generated LP line starting with{str}0The new measurement field variants are what enable writing long-running tests cases where we can assert on the values we expect to get from queries in a deterministic fashion; ie, we don't need to keep a buffer of written values, we just need to know the range of values written, query for them ordered by timestamp, then generate expected values incrementally as we iterate over the queried values in order to assert the expected and queryable values are the same.