redpanda icon indicating copy to clipboard operation
redpanda copied to clipboard

Partition list comparison made order independent

Open dlex opened this issue 3 years ago • 0 comments

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

dlex avatar Aug 09 '22 17:08 dlex

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.

dotnwat avatar Aug 15 '22 19:08 dotnwat

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.

dlex avatar Aug 22 '22 20:08 dlex

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

dotnwat avatar Sep 01 '22 21:09 dotnwat