MXS-1310: Add deterministic conflict resolution

The schemarouter can now resolve database mapping conflicts in a
deterministic manner. This will fix the problem of central databases which
are replicated shards being assigned in a non-deterministic manner.
This commit is contained in:
Markus Mäkelä
2017-07-05 19:19:49 +03:00
parent a23e81c438
commit 9618e63b5f
3 changed files with 28 additions and 3 deletions

View File

@ -365,14 +365,15 @@ typedef struct router_instance
unsigned int bitvalue; /*< Required value of server->status */
ROUTER_STATS stats; /*< Statistics for this router */
struct router_instance* next; /*< Next router on the list */
bool available_slaves; /*< The router has some slaves available */
bool available_slaves; /*< The router has some slaves available */
HASHTABLE* ignored_dbs; /*< List of databases to ignore when the
* database mapping finds multiple servers
* with the same database */
pcre2_code* ignore_regex; /*< Databases matching this regex will
pcre2_code* ignore_regex; /*< Databases matching this regex will
* not cause the session to be terminated
* if they are found on more than one server. */
pcre2_match_data* ignore_match_data;
pcre2_match_data* ignore_match_data;
SERVER* preferred_server; /**< Server to prefer in conflict situations */
} ROUTER_INSTANCE;