Skip to content

refactor(db): remove function for periodic backup of RocksDB database#6724

Open
317787106 wants to merge 4 commits intotronprotocol:developfrom
317787106:feature/remove_db_backup
Open

refactor(db): remove function for periodic backup of RocksDB database#6724
317787106 wants to merge 4 commits intotronprotocol:developfrom
317787106:feature/remove_db_backup

Conversation

@317787106
Copy link
Copy Markdown
Collaborator

What does this PR do?

Removes the periodic database backup feature (storage.backup) entirely. This includes the backup configuration class, the AspectJ aspect that intercepted pushBlock to trigger copies, the backup utility, and all associated test fixtures and config files.

Closes #6595.

Why are these changes required?

The storage.backup feature was designed to guard against data corruption from disk failures or abrupt process termination (e.g. kill -9). It has since become more harmful than helpful:

  1. The original threat no longer applies. Extensive testing has confirmed that kill -9 does not corrupt RocksDB, which was the primary motivation for the feature.
  2. Copy times block block synchronisation. As of early 2026, the mainnet state database is close to 3 TB. A single backup copy can take several hours, during which the node cannot sync blocks — a fatal risk to service stability.
  3. A better alternative exists. Operators can deploy a primary–backup pair of full nodes using node.backup (UDP keep-alive failover). If one node becomes unavailable, traffic can be switched to the standby without any file-copy disruption.

Changes:

  • Deleted DbBackupConfig, BackupDbUtil, BackupRocksDBAspect, NeedBeanCondition (common / framework).
  • Removed CommonParameter.dbBackupConfig field and Args.initRocksDbBackupProperty() initialiser.
  • Removed ConfigKey.STORAGE_BACKUP_* constants and the conditional backupRocksDBAspect Spring bean from DefaultConfig.
  • Deleted BackupDbUtilTest and config-test-dbbackup.conf; updated RocksDbDataSourceImplTest and SupplementTest to use TEST_CONF.
  • Configuration change: the storage.backup block is no longer read and has no effect. Nodes carrying this section in their config file can leave it in place without error, but it will be silently ignored.

Backward Compatibility: Not compatible with v4.8.1 or older.

This PR has been tested by:

  • Unit Tests

Follow up

Operators who currently rely on storage.backup should migrate to the node.backup primary–backup failover configuration.

Extra details

N/A

@halibobo1205 halibobo1205 added the topic:DB Database label Apr 29, 2026
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.8.2 milestone Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:DB Database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Remove periodic database backup in favor of dual-node failover

2 participants