forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FB8-76: Add current master host:port to server read only error when a…
…vailable (facebook#958) (facebook#958) Summary: Jira ticket: https://jira.percona.com/browse/FB8-76 Reference Patch: facebook@270854f Reference Patch: facebook@9f00827 Reference Patch: facebook@3e50e46 Reference Patch: facebook@9f18725 When a server is in read_only, we append the current master_host and master_port to the error message, if the server is a slave. The master_host could be either hostname or ip address, depending on how a slave is connected to the master. A new generic error code `ER_OPTION_PREVENTS_STATEMENT_EXTRA_INFO` is added, so that we can append any additional info to the fixed error message. Proposing a way to set a custom message in the `--read-only (super)` error. Note: the variable can only be set when server is in read-only (super) state. p.s. I am hesitant to add a mutex for the variable, so we will get a snapshot of the current pointer of the variable (const char*) when printing the error. Per request, we allow setting read_only_error_msg_extra without being in read_only state. The custom message can be set/reset at any time. D61383 added a new error code to allow appending extra info to read_only error message. The new error code breaks existing dependencies which expects to receive code 1290. Reverting back to use the old error, and extending the 1290 error message instead of adding a new one. This involves updating many files (which was the motivation I added a new one in D61383). Ideally we should have a more elegant solution to send extra info back to clients, which will be worked on separately. This is to fix the broken dependencies. Pull Request resolved: facebook#958 Reviewed By: lloyd Differential Revision: D14137345 Pulled By: lth
- Loading branch information
Showing
22 changed files
with
202 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.