Skip to content

Make default exchange bindings implicit #1721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 3, 2019

Conversation

hairyhum
Copy link
Contributor

@hairyhum hairyhum commented Oct 2, 2018

Split from #1715

Default bindings slow down queue creation and deletion and are not used in the actual routing logic. They are returned in some HTTP API endpoints though, therefore to merge this PR there should be some changes done in the management plugin.

There is no information in bindings which cannot be extracted from queues, which makes it possible to fake results for HTTP API. The question is should we do that or make the bindings result empty if there are no explicit bindings?

The definitions result does not contain default bindings BTW.

@hairyhum
Copy link
Contributor Author

hairyhum commented Oct 2, 2018

It seems like rabbit_binding:list is used in bindings load in both list_bindings and HTTP API. Also rabbit_binding:list_for_source, rabbit_binding:list_for_destination and rabbit_binding:list_for_source_and_destination. We can add fake bindings there for amq.default and queues.

@michaelklishin michaelklishin added this to the 3.8.0 milestone Oct 3, 2018
Routing from default exchange is performed without querying bindings
and they cannot be unbound and only show in `rabbitmqctl list_bindings`.

There is no point in keeping them and they are slowing down cleanup.
The min-masters locator was originally designed to count bindings,
but this was confusing for people wanting to distribute queues rather
than routes to queues. This was changed in 1d413ea
to count only queues which have at least one binding. But queues always
have bindings (default) and hence it's equivalent to listing queues.

Since default bindings are removed the location was broken. This commit
changes the location to actually list queues rather than bindings.
@hairyhum hairyhum force-pushed the remove-default-bindings branch from d5b490f to 10013f5 Compare December 28, 2018 13:18
Default bindings are not represented in the mnesia database but still
expected in the management UI and the rabbitmqctl command.
@hairyhum hairyhum changed the title DO NOT MERGE YET Remove default bindings Remove default bindings Dec 28, 2018
@hairyhum hairyhum requested a review from kjnilsson December 28, 2018 13:50
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are failures in the rabbitmq-management HTTP API suite.

@michaelklishin
Copy link
Collaborator

So far I see two types of failures:

  • GET /bindings/{vhost}/e/amq.default/q/{queue}/{key} returns 404
  • Some tests expect names or resource names but seem to be getting full queue records/objects

@hairyhum
Copy link
Contributor Author

hairyhum commented Jan 2, 2019

Fake bindings should have fixed that. I'll take a look.

rabbit_binding:exists checks bindings table. Since default bindings
are not in that table anymore, it should check for queue existence.
@hairyhum
Copy link
Contributor Author

hairyhum commented Jan 2, 2019

Fixed rabbit_binding:exists.

This avoids duplicates after an existing installation is upgraded.

References #1721.
@michaelklishin michaelklishin merged commit 67af90f into master Jan 3, 2019
@michaelklishin michaelklishin deleted the remove-default-bindings branch January 3, 2019 21:37
@michaelklishin michaelklishin changed the title Remove default bindings Make default bindings implicit Jan 3, 2019
@michaelklishin michaelklishin changed the title Make default bindings implicit Make default exchange bindings implicit Jan 3, 2019
michaelklishin added a commit to rabbitmq/rabbitmq-event-exchange that referenced this pull request Jan 10, 2019
hairyhum added a commit that referenced this pull request Jan 15, 2019
Versions before 3.8 create default bindings for queues in the database.
Since #1721 they are replaced with placeholders only for list operations.
We need to cleanup the bindings to improve binding performance with
older queues.

[#163224049]
hairyhum added a commit that referenced this pull request Jan 15, 2019
Backport of c7d107d
10013f5
e01dc98
7ba04a6

In 3.8 queues will not create default bindings.
Because default bindings are only used in list function, it should be
safe to run in a mixed mode with 3.8.
List functions should show implicit bindings for queues created in 3.8.

Min master locator logic is simplified and with or without default
bindings will have the same behaviour as before.

Follow-up to #1721
michaelklishin added a commit that referenced this pull request Feb 16, 2019
…_destination/1`

Follow-up to #1833. Note that #1721/master don't do it because there
the default exchange bindings are deleted at schema migration time.
michaelklishin added a commit that referenced this pull request Feb 16, 2019
…_destination/1`

Follow-up to #1721.

Even though the default exchange bindings are deleted at schema
migration time, this filtering improves backwards compatibility
for mixed version clusters.
@michaelklishin
Copy link
Collaborator

This was backported to v3.7.x in a backwards compatible way plus converted to a feature flag for further mixed version cluster compatibility in master.

kjnilsson pushed a commit that referenced this pull request Feb 20, 2019
…_destination/1`

Follow-up to #1721.

Even though the default exchange bindings are deleted at schema
migration time, this filtering improves backwards compatibility
for mixed version clusters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants