Skip to content
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

Upgrades may not replace the rabbit.schema file #1843

Closed
lukebakken opened this issue Jan 22, 2019 · 8 comments
Closed

Upgrades may not replace the rabbit.schema file #1843

lukebakken opened this issue Jan 22, 2019 · 8 comments

Comments

@lukebakken
Copy link
Collaborator

rabbitmq-users message: link

Reproduction steps:

  • Install and start RabbitMQ
  • Stop RabbitMQ, upgrade to newer version with different rabbit.schema file
  • Start RabbitMQ

The old cuttlefish schema may be in use. See the 3.7.9 to 3.7.10 upgrade for an example.

@lukebakken lukebakken self-assigned this Jan 22, 2019
@mohag
Copy link

mohag commented Jan 23, 2019

A workaround seems to be to delete /var/lib/rabbitmq/schema/rabbit.schema and restart RabbitMQ. The /usr/lib/rabbitmq/bin/rabbitmq-server script will copy the newer version in. (I'm not sure if there might be other dependencies though)

The package scripts might be one place to correct it, if there is a reason to copy it instead of using it from the installation location.

(If changes are ever made that will break old configs, it might be necessary to keep the old schema and do something like providing a rabbitmq-update-conf-format (or more likely a rabbitmq-diagnostics subcommand) to let the user manually apply it?)

@lukebakken
Copy link
Collaborator Author

lukebakken commented Jan 23, 2019

@dumbbell @michaelklishin - another fix would be to always copy the rabbit.schema file when RabbitMQ starts. The reason that may be a better fix that something in packaging is that we don't know if RABBITMQ_SCHEMA_DIR is set during install / upgrade, correct?

@michaelklishin
Copy link
Member

Always copying the schema sounds reasonable. I don't see any major risks with that.

@mohag
Copy link

mohag commented Jan 23, 2019

I'm not sure why ${RABBITMQ_SCHEMA_DIR} doesn't just default to ${RABBITMQ_HOME}/priv/schema/? Is this to allow to user to load additional schemas?

@lukebakken
Copy link
Collaborator Author

I don't know the history behind making the schema dir configurable 🤷‍♂️

@lukebakken lukebakken transferred this issue from rabbitmq/rabbitmq-server-release Jan 23, 2019
lukebakken added a commit that referenced this issue Jan 23, 2019
michaelklishin pushed a commit that referenced this issue Jan 24, 2019
Fixes #1843

(cherry picked from commit 07abb47)
@michaelklishin
Copy link
Member

@mohag schema files also come from plugins, so your understanding is basically correct.

@michaelklishin
Copy link
Member

@hairyhum has most context here

@michaelklishin
Copy link
Member

I think copying the file and overriding the one that's already there is what most people would expect: we want to have the latest schema file. The overhead of this is negligible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants