Loading snapshot should imply starting from scratch + loading snapshot
Use case (and a way to reproduce the issue):
I have an old v1.27.3
node, that I shutdown, then I use v1.27.4
binary to load a snapshot:
/home/hive/bin/hived-v1.27.4 --load-snapshot 20230410
However, I get an error instead:
2023-04-11T12:12:18.234 database.cpp:157 open ] 13 N5boost10wrapexceptISt13runtime_errorEE: Different persistent & runtime environments. Persistent: `{"compiler":"9.4.0", "debug":0, "apple":0, "windows":0, {"version":{"blockchain_version":"1.27.3","hive_revision":"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e","fc_revision":"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e","node_type":"mainnet"}}, "plugins" : ["account_by_key", "account_by_key_api", "account_history_api", "account_history_rocksdb", "block_api", "chain", "condenser_api", "database_api", "json_rpc", "network_broadcast_api", "p2p", "rc", "rc_api", "state_snapshot", "transaction_status", "transaction_status_api", "wallet_bridge_api", "webserver", "witness"]}'. Runtime: `{"compiler":"11.3.0", "debug":0, "apple":0, "windows":0, , "plugins" : []}'.Probably database created by a different compiler, build, or operating system
rethrow Different persistent & runtime environments. Persistent: `{"compiler":"9.4.0", "debug":0, "apple":0, "windows":0, {"version":{"blockchain_version":"1.27.3","hive_revision":"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e","fc_revision":"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e","node_type":"mainnet"}}, "plugins" : ["account_by_key", "account_by_key_api", "account_history_api", "account_history_rocksdb", "block_api", "chain", "condenser_api", "database_api", "json_rpc", "network_broadcast_api", "p2p", "rc", "rc_api", "state_snapshot", "transaction_status", "transaction_status_api", "wallet_bridge_api", "webserver", "witness"]}'. Runtime: `{"compiler":"11.3.0", "debug":0, "apple":0, "windows":0, , "plugins" : []}'.Probably database created by a different compiler, build, or operating system:
{"args.data_dir":"/home/hive/.hived/blockchain","args.shared_mem_dir":"/run/hive","args.shared_file_size":"25769803776","what":"Different persistent & runtime environments. Persistent: `{\"compiler\":\"9.4.0\", \"debug\":0, \"apple\":0, \"windows\":0, {\"version\":{\"blockchain_version\":\"1.27.3\",\"hive_revision\":\"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e\",\"fc_revision\":\"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e\",\"node_type\":\"mainnet\"}}, \"plugins\" : [\"account_by_key\", \"account_by_key_api\", \"account_history_api\", \"account_history_rocksdb\", \"block_api\", \"chain\", \"condenser_api\", \"database_api\", \"json_rpc\", \"network_broadcast_api\", \"p2p\", \"rc\", \"rc_api\", \"state_snapshot\", \"transaction_status\", \"transaction_status_api\", \"wallet_bridge_api\", \"webserver\", \"witness\"]}'. Runtime: `{\"compiler\":\"11.3.0\", \"debug\":0, \"apple\":0, \"windows\":0, , \"plugins\" : []}'.Probably database created by a different compiler, build, or operating system"}
database.cpp:157 open
2023-04-11T12:12:18.234 database.cpp:157 open ] args.data_dir: /home/hive/.hived/blockchain args.shared_mem_dir: /run/hive args.shared_file_size: 25769803776
2023-04-11T12:12:18.235 blockchain_worker_thread_pool.cpp:461 shutdown ] shutting down worker threads
2023-04-11T12:12:18.235 blockchain_worker_thread_pool.cpp:465 shutdown ] worker threads successfully shut down
2023-04-11T12:12:18.235 chain_plugin.cpp:676 open ] Error opening database. If the binary or configuration has changed, replay the blockchain explicitly using `--force-replay`.
2023-04-11T12:12:18.235 chain_plugin.cpp:677 open ] If you know what you are doing you can skip this check and force open the database using `--force-open`.
2023-04-11T12:12:18.235 chain_plugin.cpp:678 open ] WARNING: THIS MAY CORRUPT YOUR DATABASE. FORCE OPEN AT YOUR OWN RISK.
2023-04-11T12:12:18.235 chain_plugin.cpp:679 open ] Error: {"code":13,"name":"N5boost10wrapexceptISt13runtime_errorEE","message":"Different persistent & runtime environments. Persistent: `{\"compiler\":\"9.4.0\", \"debug\":0, \"apple\":0, \"windows\":0, {\"version\":{\"blockchain_version\":\"1.27.3\",\"hive_revision\":\"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e\",\"fc_revision\":\"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e\",\"node_type\":\"mainnet\"}}, \"plugins\" : [\"account_by_key\", \"account_by_key_api\", \"account_history_api\", \"account_history_rocksdb\", \"block_api\", \"chain\", \"condenser_api\", \"database_api\", \"json_rpc\", \"network_broadcast_api\", \"p2p\", \"rc\", \"rc_api\", \"state_snapshot\", \"transaction_status\", \"transaction_status_api\", \"wallet_bridge_api\", \"webserver\", \"witness\"]}'. Runtime: `{\"compiler\":\"11.3.0\", \"debug\":0, \"apple\":0, \"windows\":0, , \"plugins\" : []}'.Probably database created by a different compiler, build, or operating system","stack":[{"context":{"level":"warn","file":"database.cpp","line":157,"method":"open","hostname":"","timestamp":"2023-04-11T12:12:18"},"format":"rethrow ${what}: ","data":{"args.data_dir":"/home/hive/.hived/blockchain","args.shared_mem_dir":"/run/hive","args.shared_file_size":"25769803776","what":"Different persistent & runtime environments. Persistent: `{\"compiler\":\"9.4.0\", \"debug\":0, \"apple\":0, \"windows\":0, {\"version\":{\"blockchain_version\":\"1.27.3\",\"hive_revision\":\"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e\",\"fc_revision\":\"b512d8fc126fbbfb23d4de5b9154517aa00fcc4e\",\"node_type\":\"mainnet\"}}, \"plugins\" : [\"account_by_key\", \"account_by_key_api\", \"account_history_api\", \"account_history_rocksdb\", \"block_api\", \"chain\", \"condenser_api\", \"database_api\", \"json_rpc\", \"network_broadcast_api\", \"p2p\", \"rc\", \"rc_api\", \"state_snapshot\", \"transaction_status\", \"transaction_status_api\", \"wallet_bridge_api\", \"webserver\", \"witness\"]}'. Runtime: `{\"compiler\":\"11.3.0\", \"debug\":0, \"apple\":0, \"windows\":0, , \"plugins\" : []}'.Probably database created by a different compiler, build, or operating system"}}]}
Of course a workaround is to remove shared_memory.bin
file, but that shouldn't be required.