-
Notifications
You must be signed in to change notification settings - Fork 713
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
FB8-76: Add current master host:port to server read only error when available #958
Conversation
PR was updated |
…vailable 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 ---------- facebook@270854f ---------- FB8-76: Add current master host:port to server read only error when available Summary: 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. Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Reviewers: santoshb Originally Reviewed By: santoshb Subscribers: webscalesql-eng, ebergen ---------- facebook@9f00827 ---------- Add a variable for appending a custom message to server read_only error Summary: 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. Squash with https://reviews.facebook.net/D61383 Test Plan: Added tests. Reviewers: santoshb Originally Reviewed By: santoshb ---------- facebook@3e50e46 ---------- Lift restriction on setting read_only_error_msg_extra Summary: 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. Squash with https://reviews.facebook.net/D61713 Squash with https://reviews.facebook.net/D61677 (for main.range* test results) Test Plan: mtr Reviewers: santoshb Originally Reviewed By: santoshb Subscribers: webscalesql-eng ---------- facebook@9f18725 ---------- Revert to error code 1290 for read-only error Summary: 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. Squash with https://reviews.facebook.net/D61713 Squash with https://reviews.facebook.net/D61677 (for main.range* test results) Test Plan: mtr Reviewers: santoshb Originally Reviewed By: santoshb Subscribers: webscalesql-eng, anca, ebergen
All comments were addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hermanlee has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@@ -5080,12 +5080,12 @@ ER_FEATURE_DISABLED | |||
spa "El recurso '%s' fue deshabilitado; usted necesita construir MySQL con '%s' para tener eso funcionando" | |||
swe "'%s' är inte aktiverad; För att aktivera detta måste du bygga om MySQL med '%s' definierad" | |||
ER_OPTION_PREVENTS_STATEMENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code added a new ER_OPTION_PREVENTS_STATEMENT_EXTRA_INFO code. It would be better to keep to the original code instead. The value of the error code returned would match the existing 5.6 version. The return codes would be different between servers that have a master vs. those that do not, without having to parse the return string to determine if host:port were appended to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change matches existing 5.6 version:
ER_OPTION_PREVENTS_STATEMENT_EXTRA_INFO
was removed with 9f18725 in favor of ER_OPTION_PREVENTS_STATEMENT
with additional string param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only changed output to match upstream when additional parameter is an empty string e.g.
ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
instead of
ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.
in 5.6 with additional .
at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. I missed checking the last diff that reverted this behavior.
…vailable (#958) Summary: Jira ticket: https://jira.percona.com/browse/FB8-76 Reference Patch: 270854f Reference Patch: 9f00827 Reference Patch: 3e50e46 Reference Patch: 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: #958 Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 7d155e6
…vailable (#958) Summary: Jira ticket: https://jira.percona.com/browse/FB8-76 Reference Patch: 270854f Reference Patch: 9f00827 Reference Patch: 3e50e46 Reference Patch: 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: #958 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…vailable (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 Test Plan: Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I masked in the test result. Will update any test that comes up in the sandcastle if needed. Originally Reviewed By: santoshb Reviewed By: lth Differential Revision: D14137345 Pulled By: lth fbshipit-source-id: 13d23a2
…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
…vailable (percona#958) (percona#958) Summary: Jira ticket: https://jira.percona.com/browse/FB8-76 Reference Patch: facebook/mysql-5.6@270854f Reference Patch: facebook/mysql-5.6@9f00827 Reference Patch: facebook/mysql-5.6@3e50e46 Reference Patch: facebook/mysql-5.6@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/mysql-5.6#958 Reviewed By: lloyd Differential Revision: D14137345 Pulled By: lth
…vailable (percona#958) (percona#958) Summary: Jira ticket: https://jira.percona.com/browse/FB8-76 Reference Patch: facebook/mysql-5.6@270854f Reference Patch: facebook/mysql-5.6@9f00827 Reference Patch: facebook/mysql-5.6@3e50e46 Reference Patch: facebook/mysql-5.6@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/mysql-5.6#958 Reviewed By: lloyd Differential Revision: D14137345 Pulled By: lth
…vailable (percona#958) (percona#958) Summary: Jira ticket: https://jira.percona.com/browse/FB8-76 Reference Patch: facebook/mysql-5.6@270854f Reference Patch: facebook/mysql-5.6@9f00827 Reference Patch: facebook/mysql-5.6@3e50e46 Reference Patch: facebook/mysql-5.6@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/mysql-5.6#958 Reviewed By: lloyd Differential Revision: D14137345 Pulled By: lth
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
Summary:
Jira ticket: https://jira.percona.com/browse/FB8-76
Reference Patch: 270854f
Reference Patch: 9f00827
Reference Patch: 3e50e46
Reference Patch: 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, sothat 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.
Test Plan:
Updated rpl.rpl_read_only. Master_port is non-deterministic in the test, so I
masked in the test result.
Will update any test that comes up in the sandcastle if needed.
Originally Reviewed By: santoshb