Replica pruning occurs after the blocks are safely stored in the Full Copy Client. The pruning operation involves two steps. First, collect the latest pruneable block IDs from all the Replica and the Full Copy Client nodes. Secondly, create the prune command, which includes a list of the latest pruneable block IDs.
Upon receiving the prune command, all the Replica nodes verify the list of the latest pruneable block IDs and prune up to the minimal pruneable block ID.
The Full Copy Client, which contains the blockchain data starting from the genesis block, is not pruned.
Data pruning on Replica nodes is irreversible. After the data is pruned from the Replica nodes, the data is no longer available to the Client nodes. As a best practice, back up the Replica nodes before initiating a pruning process.
Pruning is enabled by default. You can configure pruning using block numbers to keep or a time parameter. The default configuration is to keep the data from the last two weeks and prune the rest.
The default Concord container pruning parameter values are as follows:
pruning_enabled: true
pruning_duration_to_keep_minutes: 20160
pruning_num_blocks_to_keep: 0
You can edit the pruning parameters on each Replica node using the command docker exec -it concord /bin/bash and vi /concord/config/application.config.
Prerequisites
-
Familiarize yourself with the impact of the pruning operation. See Pruning VMware Blockchain Nodes on AWS.
Verify that you have identified and backed up the outdated data to be pruned. See Back-Up Replica Nodes on AWS.
Verify that the Client node has an instantiated operator container. See Instantiate the Concord Operator Container for AWS.
Verify that all the Replica and Full Copy Client nodes are caught up not to lose data during pruning.
Verify that you stop all the applications invoking requests to the Client nodes using a Daml Ledger API interface.
Procedure
Results
When the pruning process is successful, you can see the following changes in the system:
The genesis block changes to a larger value.
RocksDB disk size decreases after some time.
- Verify that the disk compaction on the Concord container is successful. Run the following command on all the Replica nodes.
sudo egrep -i 'compact' `docker inspect --format={{.LogPath}} concord
Keys related to active smart contracts are not affected regardless of their age.
What to do next
You can prune outdated data on the Client node. See Pruning Client Nodes on AWS.