Release Date: 2025-11-21 Type: Patch Release (Critical Bug Fix)
Version 1.2.4 is a critical patch release that fixes a GTID parsing crash affecting systems with multiple MySQL replication sources. This issue was discovered in production environments running MySQL 8.4 with complex replication topologies. The release also includes a fix for RPM package upgrade errors.
Problem: MygramDB would crash with std::invalid_argument during replication startup when receiving GTID strings from MySQL 8.4 servers with multiple replication sources.
Root Cause:
- MySQL 8.4's GTID formatting includes embedded newlines for readability when multiple UUIDs are present
- Format:
uuid1:1-100,\nuuid2:1-200,\nuuid3:1-300(comma followed by newline) - This is MySQL's official behavior defined in
default_string_formatwith",\n"as the UUID separator - Long GTID strings (6+ UUIDs from multiple replication sources) would cause parsing failures
Solution:
- GTID strings are now normalized by removing all whitespace characters (newlines, spaces, tabs)
- Implementation follows MySQL's official parser behavior (
SKIP_WHITESPACE()macro) - Compatible with both single and multi-source replication topologies
Affected Scenarios:
- Systems replicating from multiple MySQL sources
- MySQL 8.4 servers with long GTID execution sets
- Production environments observed with 6 UUIDs (292 characters, 5 newlines)
Example GTID Format:
Original (from MySQL):
023cdb62-8398-11ee-9327-4a0008d26241:1-8178383,
ba13f0ad-f09a-11e8-b079-b2869295776e:1-183978832,
cf65e299-d4d1-11ec-9b58-caab0c3eeec8:1-107084115
Normalized (by MygramDB):
023cdb62-8398-11ee-9327-4a0008d26241:1-8178383,ba13f0ad-f09a-11e8-b079-b2869295776e:1-183978832,cf65e299-d4d1-11ec-9b58-caab0c3eeec8:1-107084115Technical Details:
- Modified:
src/storage/snapshot_builder.cpp - Uses
std::remove_ifwithstd::isspacefor whitespace removal - Applied immediately after GTID retrieval from MySQL
- Zero performance impact (one-time operation during snapshot)
Problem: RPM package upgrades would fail with "fg: no job control" error during the preun scriptlet execution.
Solution:
- Added error suppression to
%systemd_preunmacro in RPM spec - Syntax:
%systemd_preun %{name}.service || : - Ensures smooth package updates without manual intervention
Benefits:
- Eliminates upgrade failures on production systems
- No service interruption during package updates
- Compatible with all supported Linux distributions
Added comprehensive GTID whitespace handling tests (tests/integration/server/gtid_dump_test.cpp):
Test Cases:
- Single UUID with trailing newlines
- Multiple UUIDs with newlines after commas (MySQL 8.4 format)
- Real-world 6-UUID production scenario
- Mixed whitespace (spaces, tabs, newlines)
- Leading and trailing whitespace
Validation:
- All 13 GTID integration tests passing
- Verified against MySQL 8.4.7 behavior
- Tested with production-scale GTID strings (292 characters)
No configuration changes required. This is a transparent bug fix release.
Upgrade Steps:
Docker users:
# Pull the new image
docker pull ghcr.io/libraz/mygram-db:v1.2.4
# Or update docker-compose.yml
services:
mygramdb:
image: ghcr.io/libraz/mygram-db:v1.2.4RPM users:
# Download and install new RPM
sudo rpm -Uvh mygramdb-1.2.4-1.el9.x86_64.rpmSource build:
git checkout v1.2.4
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallelIf issues arise, rollback is straightforward:
# Docker
docker pull ghcr.io/libraz/mygram-db:v1.2.3
# RPM
sudo rpm -Uvh --oldpackage mygramdb-1.2.3-1.el9.x86_64.rpmMySQL Versions:
- MySQL 8.0.x ✓
- MySQL 8.4.x ✓ (now fully compatible)
Operating Systems:
- Linux (all major distributions)
- macOS (development/testing)
Breaking Changes: None
Deprecated Features: None
Zero performance impact:
- GTID normalization is a one-time operation during snapshot
- No changes to query execution or binlog processing
- No additional memory allocation
None.
Priority: High for production systems using:
- MySQL 8.4
- Multi-source replication
- RPM-based deployments
Priority: Low for:
- Single-source replication setups
- MySQL 8.0 without multi-source replication
- @libraz
Questions or Issues? Please open an issue on GitHub Issues