redpanda
redpanda copied to clipboard
Partition list comparison made order independent
Cover letter
To properly check whether the lists of partitons in rpk group describe are the same, sort both partition lists first because the order of partitions is 1 - not guaranteed and 2 - not important.
Fixes #5762
Backport Required
- [ ] not a bug fix
- [x] papercut/not impactful enough to backport
- [ ] v22.2.x
- [ ] v22.1.x
- [ ] v21.11.x
UX changes
- none
Release notes
- none
Change looks good. I'm curious under what circumstances this happened though: I don't remember seeing these out of order.
looks like a group's member list is stored in a absl::node_hash_map. i'm not familiar with all the internals, but I wouldn't expect the iteration order to change unless the container underwent something like a rehash operation. presumably that could happen with this part of the test after the first member snapshot is taken:
consumer.stop()
consumer.wait()
Suppose it could be in rpk, but I'd also expect it to simply pass through what it received.
The issue manifests itself in the MirrorMaker test. The list of partitions inside RP is indeed stable, however when partitions are copied over to Kafka with MirrorMaker, the order of partitions at the target will be arbitrary in general.
The issue manifests itself in the MirrorMaker test. The list of partitions inside RP is indeed stable, however when partitions are copied over to Kafka with MirrorMaker, the order of partitions at the target will be arbitrary in general.
fascinating. thanks for the explanation