rabbitmq-server icon indicating copy to clipboard operation
rabbitmq-server copied to clipboard

Quorum queue replica Erlang process names can conflict between queues in different virtual hosts

Open tvhong-amazon opened this issue 1 year ago • 2 comments

Describe the bug

The internal QQ process names are of the form vhost_queue. This could cause issues when vhost and queue names contain underscores.

Reproduction steps

  1. Create a 3.13.0 broker.
  2. Create 2 vhosts called "foo" and "foo_bar"
  3. On vhost "foo", create a QQ called "bar_baz"
  4. On vhost "foo_bar", create a QQ called "baz"
  5. Observe the following error: image

Expected behavior

User can successfully create both QQs.

Additional context

No response

tvhong-amazon avatar Apr 19 '24 00:04 tvhong-amazon

No matter what separator you pick, there will be a risk of such conflict. OTP system processes often use dollar signs for separators.

It's a good question what version a change like this can ship it. But given that these are process names, not replica identities (those are pairs), possibly this can go into 3.13.x.

michaelklishin avatar Apr 19 '24 03:04 michaelklishin

@tvhong-amazon it turns out, there is an alternative strategy that's used already but only for names that are longer than 255 bytes long.

And this value is persisted as part of replica state.

So what can be done to avoid is

  1. Use the current strategy
  2. If the concatenated process name is longer than 255 bytes or we run into certain exceptions, use an alternative strategy

michaelklishin avatar Apr 19 '24 11:04 michaelklishin