-
Notifications
You must be signed in to change notification settings - Fork 445
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
fix: Restore pre-Tutor 16 behavior, disable the MySQL binlog by default #922
Conversation
@regisb Please don't consider this for merging yet as I still need to do a decent amount of testing, but can you let me know if you agree with the general rationale here? I think it would also be okay for the config option to be But I do think it should be configurable. |
b505f6a
to
c4d101e
Compare
Thanks for the detailed explanations Florian. Yes, I agree with the rationale. It makes sense not to create an infinitely growing log file by default. I'd rather avoid creating a setting just for this though -- but you knew I would say this, right? ;) Then again, I agree that users should be able to configure this parameter. Is it sufficient if plugins can override the I'm grateful for your testing. In particular, I'd like to know what's going to happen to the binlog file for current tutor v16 users who upgrade to the next version, where the binglog file will be disabled. |
Well you're already saying you're going to make something configurable. :) If you object to a separate option for the binlog, then I'd suggest you also reconsider the hard-coded character set fix from #890/#896, and introduce an option named But I don't see how it makes sense to hard-code some So, if Tutor is meant to decide which options should be set (i.e. which
When mysqld restarts, it will no longer be capable of acting as a replication master, nor will it be able to do point-in-time restore. To the best of my knowledge, pre-existing binlog files will remain in place, being somewhat useless, and will need to be removed manually. |
Summarizing test results. Starting
@regisb, have you made up your mind on which way the default should go, and/or what to do about |
I suggest we go with a file-based Would such a solution work for you? |
It would work but I'd strongly dislike it, to be frank. |
Up to Tutor 15, when Tutor was configured with `RUN_MYSQL: true`, it ran MySQL 5.7, which disabled binary logging ("the binlog") by default unless enabled with the `--log-bin` option. In Tutor 16, we switched to MySQL 8 which flipped this default: now, the binlog is enabled by default, unless disabled with `--skip-log-bin` or `--disable-log-bin`. The binlog is relevant for two purposes: 1. MySQL replication. 2. Point-in-time restore (that is, incrementally rolling forward from the most recently restored full backup, using binlog data). However, in case neither of those purposes are relevant to the Tutor deployment at hand (and it stands to reason that in most deployments they are not), enabling the binlog comes with disadvantages: * In busy Open edX databases, the binlog files can grow to considerable size, particularly considering the default expiry period for the binlog is a whopping 30 days. * This can cause a MySQL volume to fill up and then disable the database altogether, because it runs into `ENOSPC` ("no space left on device") errors. * This is especially true in `tutor k8s` configurations, where the MySQL volume size is just 5 GiB by default. Thus, restore the pre-Tutor 16 behavior of running without the binlog by default, and give users the opportunity to enable it by setting `MYSQL_ENABLE_BINLOG: true`. Reference: https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#option_mysqld_log-bin
c4d101e
to
4ab0025
Compare
Meanwhile I've taken the liberty to rebase this on 16.1.4. Also, @mrtmm kindly gave this another pair of eyes, and a test run in a dev environment. |
Why is that? Is it because it would require creating a plugin? |
Just for the same reason where we already know that we respectfully disagree with each other. :) It's because rather than curbing the growth of complexity, it only shifts complexity from the developer to the user. I've recently counted, and we carry 25 plugins on our production platform, out of which more than half do not add any functionality, but only modify configuration settings. I think it's just as fair for you as the upstream developer to say "I don't want more config options, for they add complexity and increase my maintenance burden" as it is for me as a downstream user to say "I don't want more plugins, for they add complexity and increase my maintenance burden". :) But like I said, there's no real way to resolve that conundrum, so it's always a compromise. However, I just really don't understand the logic of adding a facility that drops a So I think you can pick either one or the other, that is, either trying to be clever about |
I've converted this back to a draft since running
Why it would break with precisely that error I have no idea, but the problem started popping up when adding |
PR #926 (also a Draft right now, pending further testing) may be an alternate approach here that does without a new config option. |
@fghaas this part of your comment really struck me. Yes, 25 plugins are too much. You are without a doubt a power user of Tutor! And it's crucial that Tutor works well for power users, because all users hope to become power users. I'm wondering what fundamental distinction you make between plugins and configuration settings. Are configuration settings easier to modify because you can just run
Yes, sorry about my confusing comment. I do want to move all current |
Just to update this part: this was probably unrelated. Rather than being due to |
Up to Tutor 15, when Tutor was configured with
RUN_MYSQL: true
, it ran MySQL 5.7, which disabled binary logging ("the binlog") by default unless enabled with the--log-bin
option.In Tutor 16, we switched to MySQL 8 which flipped this default: now, the binlog is enabled by default, unless disabled with
--skip-log-bin
or--disable-log-bin
.The binlog is relevant for two purposes:
However, in case neither of those purposes are relevant to the Tutor deployment at hand (and it stands to reason that in most deployments they are not), enabling the binlog comes with disadvantages:
ENOSPC
("no space left on device") errors.tutor k8s
configurations, where the MySQL volume size is just 5 GiB by default.Thus, restore the pre-Tutor 16 behavior of running without the binlog by default, and give users the opportunity to enable it by setting
MYSQL_ENABLE_BINLOG: true
.Reference:
https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#option_mysqld_log-bin