Skip to content

refactor: optimize RocksDB memory footprint and improve test stability #39

Merged
axfor merged 2 commits intomainfrom
axfor
Jan 9, 2026
Merged

refactor: optimize RocksDB memory footprint and improve test stability #39
axfor merged 2 commits intomainfrom
axfor

Conversation

@axfor
Copy link
Copy Markdown
Owner

@axfor axfor commented Jan 9, 2026

axfor added 2 commits January 9, 2026 15:17
- Change MySQL protocol query logs from Info to Debug level
- Remove debug fmt.Printf statements from MySQL handler
- Fix TestMutexWatchEventHandling flaky test by:
  - Increasing wait time before unlock to 500ms
  - Using non-blocking select for lock acquisition order
  - Increasing timeout to 20 seconds
- Replace clientv3.New() with NewEtcdClient() for quiet logging
- Fix RocksDB test cleanup order (client before server)
- Reduce RocksDB default memory usage from ~1GB to ~10MB:
  - Block cache: 512MB -> 8MB
  - Write buffer: 64MB -> 4MB
  - Max write buffers: 3 -> 2
  - WAL max size: 512MB -> 32MB
  - Background jobs: 4 -> 2

- Add configurable RocksDB performance tuning via config.yaml:
  - block_cache_size, write_buffer_size, max_write_buffer_number
  - max_background_jobs, compression (none/snappy/lz4/zstd)

- Remove writeMu from Memory storage (Raft guarantees serialization)

- Fix flaky TestLockFairness tests by adding short mode skip

- Clean up unused config files (mysql_example.yaml, 2node_ha_example/)

- Fix test compilation errors after revision field type change
@axfor axfor merged commit 59c26a8 into main Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant