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

FB8-76: Add current master host:port to server read only error when available #958

Closed
wants to merge 1 commit into from

Conversation

inikep
Copy link
Contributor

@inikep inikep commented Feb 11, 2019

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.

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

sql/rpl_slave.cc Outdated Show resolved Hide resolved
@inikep
Copy link
Contributor Author

inikep commented Feb 12, 2019

PR was updated

sql/rpl_slave.cc Outdated Show resolved Hide resolved
sql/rpl_slave.cc Outdated Show resolved Hide resolved
sql/rpl_slave.cc Outdated Show resolved Hide resolved
sql/rpl_slave.h Outdated Show resolved Hide resolved
…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
@inikep
Copy link
Contributor Author

inikep commented Feb 12, 2019

All comments were addressed

Copy link
Contributor

@percona-ysorokin percona-ysorokin left a comment

Choose a reason for hiding this comment

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

LGTM

@inikep inikep changed the title WIP FB8-76: Add current master host:port to server read only error when available FB8-76: Add current master host:port to server read only error when available Feb 13, 2019
Copy link

@facebook-github-bot facebook-github-bot left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

@inikep inikep Feb 26, 2019

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.

Copy link
Contributor

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.

@hermanlee hermanlee closed this Mar 6, 2019
facebook-github-bot pushed a commit that referenced this pull request Mar 6, 2019
…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
facebook-github-bot pushed a commit that referenced this pull request Nov 18, 2019
…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
@inikep inikep deleted the FB8-76 branch January 7, 2020 10:28
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 20, 2020
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 21, 2020
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 28, 2020
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 28, 2020
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 29, 2020
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 10, 2020
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 10, 2020
…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
hermanlee pushed a commit to hermanlee/mysql-5.6 that referenced this pull request Oct 18, 2023
…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
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 15, 2024
…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
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 16, 2024
…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
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 17, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Apr 23, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Apr 25, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 7, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 8, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 9, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 10, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 13, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 15, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 16, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 17, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 21, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 21, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 30, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 12, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 13, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 14, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 19, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 20, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 21, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 25, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 2, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 19, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 19, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jul 31, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 2, 2024
…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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 6, 2024
…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
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.

6 participants