Fix FaultTolerantPartitioningScheme obtaining logic#19979
Fix FaultTolerantPartitioningScheme obtaining logic#19979losipiuk merged 4 commits intotrinodb:masterfrom
Conversation
There was a problem hiding this comment.
withPartitionCount became unused, remove
There was a problem hiding this comment.
before the change, we guaranteed that "if value is taken from the cache, the partitionCount is made to be exactly as requested".
i don't know why we didn't guarantee that for new values.
maybe we could add this
if (partitionCount.isPresent()) {
verify(result.getPartitionCount() == partitionCount.get(), "...");
}however, create doesn't seem to guarantee this property -- return new FaultTolerantPartitioningScheme(1, ....
Thus this PR (1) fixes caching logic
and introduces a pretty subtle side-effect (maybe correct). If this side effect is intentional, it would be good to call it out (perhaps as separate commit)
There was a problem hiding this comment.
I am pretty sure this method should not be called with non-empty partition count for case when create would return scheme with partitionCount == 1.
verify seems like a good change.
There was a problem hiding this comment.
move below create, maybe bottom of the class
With caching logic used when FaultTolerantPartitioningScheme was obtained it was possible to get FaultTolerantPartitioningScheme with wrongly set partition count. In cache keyed on PartitioningHandle we could store a FaultTolerantPartitioningScheme object obtained for specific partitionCount value. Later on when we asked for same handle but without specifying partitionCount we still got cached FaultTolerantPartitioningScheme. This commit changes cache key to inclue partitionCount.
2d382d1 to
6eefc88
Compare
There was a problem hiding this comment.
a data provider would produce much more readable failure messages
otherwise when inspecting CI error message you need to hope the line numbers didn't change between CI and your local copy
out of scope for this pr
The FTE configuration used for tests was missing fault-tolerant-execution-min-partition-count-for-write, the default value (50) was not compatible with fault-tolerant-execution-max-partition-count which was explicitly set to 5. Adding fault-tolerant-execution-min-partition-count-for-write set to 2 and also fault-tolerant-execution-min-partition-count for completeness
6eefc88 to
6aa13dc
Compare
With caching logic used when FaultTolerantPartitioningScheme was obtained it was possible to get FaultTolerantPartitioningScheme with wrongly set partition count. In cache keyed on PartitioningHandle we could store a FaultTolerantPartitioningScheme object obtained for specific partitionCount value. Later on when we asked for same handle but without specifying partitionCount we still got cached FaultTolerantPartitioningScheme.
This commit changes cache key to inclue partitionCount.
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: