Rework find_and_delete_entries (bugfix and better testing) #172
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 vastly improves the quality, reliability and behaviour of the
find_and_delete_entries
in the metadata mixin.batch_size
parameter was effectively ignored. FIX: it is no moreBut most importantly, a major bug has been fixed:
The
find_and_delete_entries
did not work when in combination with the clustered mixin and/or the multiple primary key mechanism. The reason was that the collection of primary keys (to be later used in deleting) did use the query results after the normalization, so that the flat structure of the table had been made into e.g.{"partition_id": ("x", 10), "row_id": ("a", 1), ...}
in case of multicolumn (primary/clustering) key. The deletions then failed miserably.find_entries
is split into a pre- and a post-row-normalization parts, so that thefind_and_delete_entries
can use the former and get access to the actual columns, which is what it needs for the later delete statements.As a final note, everything in this PR is doubled in its asyncio counterpart.