-
Notifications
You must be signed in to change notification settings - Fork 976
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
Refactor and optimize read-only actions + Simulator (combined) #4127
Refactor and optimize read-only actions + Simulator (combined) #4127
Conversation
b803c8d
to
3aa4055
Compare
Hi @rahim-kanji, maybe I'm out of the loop here, any reason for commit 3aa4055 ? Otherwise it should be reverted before merging this PR. It's a fix for fixing incompatibilities between another monitoring threads that call |
Had a discussion and commit reverted. |
retest this please |
…ith_simulator' into v2.x_refactor_read_only_action_with_simulator
retest this please |
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.
Minor shared enhancements observed during the review of #4144
Looking great! 🎉 |
…milliseconds, which is then converted into microseconds. Fixed in read_only_actions_v2.
retest this please |
Refactor and optimize read-only actions PR
Optimize read-only actions by removing the dependency on proxysql admin tables. Instead, a separate mapping container is maintained, which records the state of the HGM servers. This avoids the need to call the commit method on every change, which improves performance. The changes in this commit also ensure that the mapping container is properly updated when servers are added, removed or modified.
Read only simulator PR
This commit introduces a first simulator for read_only monitoring
ProxySQL itself will simulate hundreds of backends across hundreds of
hostgroups, all configured in hundreds of clusters, and return read_only
values for each of the simulated backend.
The read_only value can be configured in table READONLY_STATUS available in
the SQLite3Server module.
If a backend isn't configured in table READONLY_STATUS , its default read_only
value is 1.
It is possible to simulate a lot of simultaneous failover running queries like
the following:
UPDATE READONLY_STATUS SET read_only=1;
CREATE TABLE t1 AS SELECT hostname FROM READONLY_STATUS ORDER BY RANDOM() LIMIT 50;
UPDATE READONLY_STATUS SET read_only=0 WHERE hostname IN (SELECT hostname FROM t1);
DROP TABLE t1;