MDEV-37608: Increase default binlog_row_event_max_size to 64k#4697
MDEV-37608: Increase default binlog_row_event_max_size to 64k#4697KhaledSayed04 wants to merge 1 commit intoMariaDB:mainfrom
Conversation
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
Good job on the performance evaluation!
Several things to fix here:
- Please use a single commit
- Make sure the commit message complies to CODING_STANDARDS.md
- Re-record mysql--help to reflect the new value
- (optional) Consider adding a specialized test for this variable, similar to e.g. binlog_cache_size_basic.test
415de5c to
34a7d3c
Compare
|
Hi @gkodinov, I've implemented the default change to 64k and added the basic system variable tests. These failures occur because of some environment conditions that I couldn't catch. I have ran the failing tests locally and they passed. Regarding expectations based on the legacy 8k event boundaries for some other tests, I have investigated two ways to resolve this:
Given that this task was marked as 'beginner-friendly,' the second option (pinning) seems more localized, but I'm happy to perform the full refactor if you prefer the first. |
|
Yes, I think pinning should be OK. |
|
The embedded failure occurs because of the following: Note how the rest of the variables in the .opt file that are unknown are prefixed with --loose? Although they're not really dynamic. It's because of the embedded case where these are (apparently) not sourced. |
gkodinov
left a comment
There was a problem hiding this comment.
We're very close. Let's just fix the failing buildbot tests. The rest is fine.
mysql-test/main/vector.opt
Outdated
| @@ -0,0 +1 @@ | |||
| --binlog-row-event-max-size=8192 | |||
There was a problem hiding this comment.
prefix with --loose here because it's run in embedded mode.
0c772a7 to
a8e4f45
Compare
|
@gkodinov These tests don't fail all at once when running CI to group them all. They appear one by one. Is modifying |
|
To build on my previous comment, I’ve performed a deeper static analysis to identify why some tests (like the Windows bootstrap) fail in CI despite passing in my local environment. The 64k default creates a "physics shift" in event packing and memory overhead that the legacy test suite is highly sensitive to. I’ve identified the following candidate affected tests that likely require pinning to maintain stability across different architectures (Linux, Windows, etc.):
Given that nearly 200 tests are potentially affected by these implicit environment dependencies, I think the single-line addition to I understand that individual .opt files make requirements explicit. However, given that these 200+ candidates are 'implicitly' dependent on the old default, Path A (global pin) provides a cleaner baseline. A possible compromise: We could use default_mysqld.cnf for the general stability of the suite, and I can add specific .opt files only for the primary 'Replication' and 'Vector' tests that are most critical for documenting these boundaries. This avoids PR bloat while maintaining documentation where it matters most. Looking forward to your guidance on which approach aligns best with the MariaDB testing philosophy. |
|
Hi @KhaledSayed04 ! It is good to update tests for new configurations, as this makes it obvious what problems users may run into when upgrading. Future tests will also more closely resemble our users behaviors. I'd suggest the following:
The above three cases don't seem to rely on
These tests seem to rely on behavior from Otherwise it looks good! If you can fix the tests by March 10, we can get this patch into the upcoming |
a8e4f45 to
ae980e8
Compare
The default value of binlog_row_event_max_size is increased from 8k to 64k to improve binary log efficiency for modern workloads. To maintain compatibility with the existing test suite: - Updated the default in sys_vars.cc. - Added a basic test for the system variable in suite/sys_vars. - Implemented surgical pinning for ~60 tests using the 'loose-' prefix in .opt files. This addresses protocol and memory-sensitive tests that previously triggered ER_TRUNCATED_WRONG_VALUE or result mismatches due to the 64k boundary.
ae980e8 to
d4cc25e
Compare
Summary:
This PR updates the default value of
binlog_row_event_max_sizefrom 8,192 bytes (8k) to 65,536 bytes (64k).Technical Rationale:
The legacy 8k default causes extreme fragmentation in the binary log when handling modern workloads with large row payloads. By increasing this limit to 64k, the engine can aggregate more rows into fewer
Write_rowsevents.My benchmarks show that for a transaction involving 1,000 rows (5KB each), the 64k default reduces the number of binary log events from 1,000 to 77—a 92.3% reduction in header and metadata overhead. While 128k offers slightly better aggregation (39 events), 64k represents the optimal balance for memory allocation and network MTU efficiency.
Benchmark Results
Test Case: 1,000 rows inserted in a single transaction (5KB payload per row).
Test Environment
Verification
mtr binlog.binlog_row_binlog.Click to view Benchmark Script