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

希望添加判断数据库是否可读的开关 #412

Closed
quanbisen opened this issue Dec 10, 2021 · 6 comments
Closed

希望添加判断数据库是否可读的开关 #412

quanbisen opened this issue Dec 10, 2021 · 6 comments
Labels
wontfix This will not be worked on

Comments

@quanbisen
Copy link

描述您想要的功能:
我目前有在基于开源项目archery定制开发,支持公司内部的mycat数据库中间件,不做SQL备份。不过有一个问题,goinception每次执行的时候会判断数据库是否是read_only模式,如果mycat是读写分离模式的话,goinception可能直接返回,不执行了,参见代码

if s.checkIsReadOnly() { 
        s.appendErrorMessage("当前数据库为只读模式,无法执行!") 
        return 
}

描述您考虑过的解决/替代方案:
希望能在提交给goinception执行的配置中能添加是否开启数据库read_only检查,参数建议为read_only_check,谢谢。

可参考文档,资料,引用等:

@hanchuanchuan
Copy link
Owner

即使不进行read_only的检查,SQL语句也无法执行成功吧?或者只是SELECT语句吗?

@quanbisen
Copy link
Author

即使不进行read_only的检查,SQL语句也无法执行成功吧?或者只是SELECT语句吗?

执行是可以执行的,但是mycat是读写分离模式的话,select @@read_only返回的是只读模式的。mycat是不支持备份模式。

@hanchuanchuan
Copy link
Owner

版本已升级,新参数check_read_only,值默认为true,请下载v1.2.5-11版本后重试。

@quanbisen
Copy link
Author

版本已升级,新参数check_read_only,值默认为true,请下载v1.2.5-11版本后重试。

您好,我看了一下更新的代码,好像这个参数是写在了配置文件的,这个配置参数可以在提交给goinception的文本中设置吗?

@quanbisen
Copy link
Author

版本已升级,新参数check_read_only,值默认为true,请下载v1.2.5-11版本后重试。

我看了一下源码,确实是在配置文件中设置,提交给goinception的sql文本中并没有加载参数的操作,好像这个是直接交给下面的引擎执行的了。那就没必要解析它了,这个参数是goinception的设置,理论上是只放在配置文件。谢谢大佬。

@stale
Copy link

stale bot commented Apr 16, 2022

由于此问题没有最近的活动,因此已被自动标记为陈旧。如果没有进一步的活动,会作为不活跃issue关闭。感谢你对本项目的贡献。 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 16, 2022
@stale stale bot closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants