Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
10.2.9
-
Debian Jessie, Fedora Core 26
Description
Hi Guys, I found this new great feature of mariadb (log compression), but unfortunately i cannot make it working. Basically on the servers we're writing terabytes of logs on SSD disks so that would be great if I can get it enabled.
log_bin_compress_min_len=10
log_bin_compress=1
log_bin_compress_min_len=10
log_bin_compress='ON'
log_bin_compress_min_len=128
log_bin_compress='ON'
Nothing works as expected. I tried enabling by SET GLOBAL and also using config file
https://mariadb.com/kb/en/library/compressing-events-to-reduce-size-of-the-binary-log/
Still there's plaintext in the log and it doesn't seem that anything is getting compressed... i'm doing something wrong or this feature is no longer supported / broken in 10.2.9?
Log file dump:
https://www.screencast.com/t/08Ig7s023Jzg
Thanks,
Slawomir.
pslawek83,
What makes you think that the log in the screenshot is not compressed? It seems compressed to me.
Let's take the first event as an example, the UPDATE.
The fact that you can see the statement in plain text is not an indication of the events being or not being compressed. Most likely you have Annotate_rows events turned on (they are ON by default in 10.2), that's what you see as the plain text. You can switch binlog_annotate_row_events=off if you don't want them.
Further, we have accounts (probably the schema name) and ___targets_mapping... (the table name) – the table map.
But after that, we only see garbage. If it was still clear text, we would have seen the old and new field values, including the easily recognizable long 'sssssss...', but it's not there. The next cleartext event is COMMIT, which is never compressed anyway.
I didn't dig into other events, but I think it's the same for them.
Further, if you are judging by the log size, please note that it's event compression, not log compression. Even if you are writing terabytes of logs, but each individual event is as small as the ones we see in the screenshot, then probably you'll have minimal effect, if any at all.
For a simple experiment to see that the events are written in the special compressed format, use mysqlbinlog to read the binlog. It will show Update_compressed_rows: and such as event types.
For an even simpler experiment to see that the compression actually affects the binlog size, try to write some very long and well-compressible text into a large text column and compare binlog size of such an event written with compression turned on vs compression turned off. You can switch compression on/off dynamically, you don't need to restart the server for that.