diff --git a/designate/coordination.py b/designate/coordination.py index 2efbd8c78..f107d1da2 100644 --- a/designate/coordination.py +++ b/designate/coordination.py @@ -48,7 +48,7 @@ class CoordinationMixin(object): backend_url = CONF.coordination.backend_url self._coordinator = tooz.coordination.get_coordinator( - backend_url, self._coordination_id) + backend_url, self._coordination_id.encode()) self._coordination_started = False self.tg.add_timer(CONF.coordination.heartbeat_interval, diff --git a/designate/producer/service.py b/designate/producer/service.py index cd0c8a0b7..b9c196ee6 100644 --- a/designate/producer/service.py +++ b/designate/producer/service.py @@ -66,8 +66,8 @@ class Service(service.RPCService, coordination.CoordinationMixin, super(Service, self).start() self._partitioner = coordination.Partitioner( - self._coordinator, self.service_name, self._coordination_id, - range(0, 4095)) + self._coordinator, self.service_name, + self._coordination_id.encode(), range(0, 4095)) self._partitioner.start() self._partitioner.watch_partition_change(self._rebalance) diff --git a/releasenotes/notes/bug-1828534-ensure-coordination-ids-are-encoded-b5f32b9e16339251.yaml b/releasenotes/notes/bug-1828534-ensure-coordination-ids-are-encoded-b5f32b9e16339251.yaml new file mode 100644 index 000000000..8849eac45 --- /dev/null +++ b/releasenotes/notes/bug-1828534-ensure-coordination-ids-are-encoded-b5f32b9e16339251.yaml @@ -0,0 +1,12 @@ +--- +upgrade: + - | + While this patch fixes upgrades from patched Python 2 to patched + Python 3 designate releases, the issue will still be present on + upgrade from unpatched Python 3 to patched Python 3 designate + releases. +fixes: + - | + This fixes an issue when upgrading to Python 3 (where bytes and str are + different types) and _update_partitions() attempts to sort types of 'str' + and 'bytes', causing designate-producer to crash.