Skip to content
Snippets Groups Projects
Commit 39bec27b authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy Committed by Serge Petrenko
Browse files

replication: split anon cfg and actual 'is anon'

To tell whether the instance is anon there used to be just one
flag in C code: replication_anon.

Having one flag both for cfg and for the actual state is bad
because if cfg is updated, then there is a moment when that flag
can't be safely used to check the actual state.

For example, when replication_anon had been true and was set to
false, it took time to register the instance. In the meantime the
C flag replication_anon was already false, although the instance
is still anon (not present in _cluster).

In the existing code it could lead to insignificant errors like
when an anon instance was being registered, it could already
accept IPROTO_REGISTER requests. It would fail on ER_READONLY
instead of ER_UNSUPPORTED. It wasn't a critical problem, but still
it wasn't correct to use cfg flag for checking the actual state.

Now there is a separate cfg flag and a function for checking the
real state.

This patch is done because soon there will be a new option which
also takes time to change: instance name. This commit sets a
pattern how to deal with such options.

In scope of #5029

NO_DOC=refactoring
NO_CHANGELOG=refactoring
NO_TEST=already covered
parent d6547bba
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment