Skip to content

server_version is not available for slaves #8392

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

Closed
wants to merge 1 commit into from

Conversation

jdeniau
Copy link
Contributor

@jdeniau jdeniau commented Sep 14, 2017

No description provided.

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

Thanks for this fix and congrats on your first contribution to this repo!

I have a question: does setting this option throw an exception or is it ignored? If is it ignored, is it because of a Doctrine bug or is it because it's OK to not configure the server_version of slaves? (which at first it seems strange because if not setting this option to the master causes troubles, it should cause them too for the slaves).

@jdeniau
Copy link
Contributor Author

jdeniau commented Oct 4, 2017

@javiereguiluz it does throw the following exception :

 Unrecognized option "server_version" under "doctrine.dbal.connections.foo_master.slaves.foo_slave"

Apparently, it's more a bug in the DoctrineBundle implementation, because if you look in doctrine's MasterSlaveConnection, you can see a chooseConnectionConfiguration.

This methods seems to get the master or slave configuration, to do platform specific things, like converting from/to database, so the serverVersion seems to be "host-specific".

I can eventually help with this, but I do not really know DoctrineBundle internals, so maybe another person can be more at ease with this ;)

Anyhow, I think that the case "Our master is Mysql 5.7, our slave is Mysql 5.6, and there is a doctrine specific code that will target only 5.7" ;)

If you want to close this, because it "should" work like this, no problem.

@javiereguiluz
Copy link
Member

@jdeniau thanks for the info. I agree merging this change because the current behavior is wrong. But I've created doctrine/DoctrineBundle#711 too to see if this can be changed or not. Thanks!

@xabbuh xabbuh added this to the 2.7 milestone Oct 13, 2017
@xabbuh
Copy link
Member

xabbuh commented Oct 13, 2017

Thank you @jdeniau.

xabbuh added a commit that referenced this pull request Oct 13, 2017
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #8392).

Discussion
----------

server_version is not available for slaves

Commits
-------

0684c98 server_version is not available for slaves
@xabbuh xabbuh closed this Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants