tronprotocol / java-tron

Java implementation of the Tron whitepaper
GNU Lesser General Public License v3.0
3.76k stars 1.41k forks source link

checkpoint check failed, can't convert checkpoint from v2 to v1 #5357

Closed nateless closed 1 year ago

nateless commented 1 year ago

System information

java-tron version: java -jar FullNode.jar -v OS : Linux JVM : Oracle Corporation 1.8.0_341 amd64 Git : 9e95599de2a9d60f4e706d18d3b71ac8850a0c01 Version : 4.7.2 Code : 18031

Expected behaviour

Should start

Actual behaviour

checkpoint check failed, can't convert checkpoint from v2 to v1

Steps to reproduce the behaviour

wget https://fullnode-backup-2.s3-eu-central-1.amazonaws.com/FullNode-52871735-4.7.2-output-directory.tgz tar -zxvf FullNode-52871735-4.7.2-output-directory.tg java -Xmx64g -XX:+UseConcMarkSweepGC -jar FullNode.jar -c main_net_config.conf

Backtrace

18:21:53.570 INFO  [main] [DB](LevelDbDataSourceImpl.java:147) DB common-database open success with writeBufferSize 16 M, cacheSize 32 M, maxOpenFiles 100.
18:21:53.576 INFO  [main] [DB](LevelDbDataSourceImpl.java:147) DB pbft-sign-data open success with writeBufferSize 16 M, cacheSize 32 M, maxOpenFiles 100.
18:21:53.603 INFO  [main] [DB](LevelDbDataSourceImpl.java:147) DB tree-block-index open success with writeBufferSize 16 M, cacheSize 32 M, maxOpenFiles 100.
18:21:53.603 INFO  [db-stats-thread-0] [metrics](DbStat.java:20) DB tree-block-index, level:0,files:2.0,size:1.0 M
18:21:53.604 INFO  [db-stats-thread-0] [metrics](DbStat.java:20) DB tree-block-index, level:1,files:4.0,size:8.0 M
18:21:53.604 INFO  [db-stats-thread-0] [metrics](DbStat.java:20) DB tree-block-index, level:2,files:49.0,size:99.0 M
18:21:53.604 INFO  [db-stats-thread-0] [metrics](DbStat.java:20) DB tree-block-index, level:3,files:83.0,size:170.0 M
18:21:53.610 INFO  [main] [DB](LevelDbDataSourceImpl.java:147) DB section-bloom open success with writeBufferSize 16 M, cacheSize 32 M, maxOpenFiles 100.
18:21:53.611 INFO  [db-stats-thread-0] [metrics](DbStat.java:20) DB section-bloom, level:0,files:0.0,size:0.0 M
18:21:53.644 INFO  [main] [DB](LevelDbDataSourceImpl.java:147) DB trans-cache open success with writeBufferSize 16 M, cacheSize 32 M, maxOpenFiles 100.
18:21:53.656 ERROR [main] [DB](SnapshotManager.java:496) checkpoint check failed, can't convert checkpoint from v2 to v1
ferdinand026 commented 1 year ago

@nateless From the log, the node enabled the checkpoint v2 before, and now the checkpoint version is v1, but after the node enabled checkpoint v2, it does not support rollback from v2 to v1. So you can modify the configuration file to set storage.checkpoint.version = 2 to solve this issue, then restart the node.

ClarkChenc commented 1 year ago

hi, @nateless, there is config in main_net_config.conf called checkpoint.version, and its default value is 1. If the node ever starts with checkpoint.version = 2, such config must maintain checkpoint.version = 2 afterwards for compatibility.

The phenomenon you metioned above seems to be in that case. If the config is ever be set, there will exits a directory called checkpoint, and snapshot may also be built with that config. You can check the config if you miss such info, or would you please share the reason of switching from checkpoint.version = 2 to checkpoint.version = 1 if it is done intentionally? Maybe it can help to make some improvements.

nateless commented 1 year ago

Thanks @ferdinand026 and @ClarkChenc , your assistance was indeed helpful. We didn't previously have this setting in our main_net_config.conf configuration file. However, after implementing it, everything started up without any problems.

halibobo1205 commented 1 year ago

@nateless Would you like to submit a PR to help improve this issue? Give a tip to set checkpoint.version = 2, like this ERROR [main] [DB](SnapshotManager.java:496) checkpoint check failed, can't convert checkpoint from v2 to v1, please set checkpoint.version = 2.