eos icon indicating copy to clipboard operation
eos copied to clipboard

database dirty flag set (likely due to unclean shutdown): replay required

Open hyqsfaf opened this issue 8 years ago • 34 comments

Don't want to delete the data and resynchronize. How to change it.

hyqsfaf avatar Jul 19 '18 02:07 hyqsfaf

please use --hard-replay

taokayan avatar Jul 19 '18 02:07 taokayan

You can relpay the chain with "--replay-blockchain --hard-replay-blockchain" when start the eos like the comments in https://github.com/EOSIO/eos/issues/4002 However, the replay will take 3 hours for whole blocks now (6,500,000 +), be patient.

You should stop docker with -t 300 becasue default 10 secs is not enough to stop eos docker which will cause dirty flag. You can review some comments in https://github.com/EOSIO/eos/issues/4462

BTW: Be careful when you docker start WITHOUT "--replay-blockchain --hard-replay-blockchain" at the second docker start.

BTW2: Update to eos 1.1.0 will speed up sync.

lcgogo avatar Jul 19 '18 03:07 lcgogo

The "--replay-blockchain" or "--hard-replay-blockchain" option takes too long for replaying.

Should we add an option to allow the nodeos backups the shared_memory.bin periodically, such as one time per hour? In this way, the increased state will be synced in a short time.

ridewindx avatar Jul 19 '18 06:07 ridewindx

Replaying takes considerably less time with v1.1. You can expect 1 million blocks in 20 minutes, for a total synch time of barely an hour to mainnet.

jgiszczak avatar Jul 19 '18 19:07 jgiszczak

Same problem. My machine has around 40 GB memory, and the data synced

> du -sh *
4.0K	README.md
12K	Wallet
5.8G	blocks
4.0K	cleos.sh
8.0K	config.ini
4.0K	genesis.json
4.0K	nodeos.pid
36K	scripts
4.0K	start.sh
32G	state
4.0K	stderr.txt
0	stdout.txt
4.0K	stop.sh
------
sum:   38G

I have history plugin and filter-on = * configuration set, but the usual mem usage is about 400 Mb. So before doing replay I want to make sure whether the error means I need to scale my machine?

bitrocks avatar Jul 20 '18 03:07 bitrocks

@ridewindx I totally agree with adding an automatic backup option, as the --reply-blockchain and --hard-replay-blockchain are definitely taking hours to sync 1 mil blocks in my test server (8 GB Droplet) in DigitalOcean; we should facilitate the resyncing speed at least for constrained analytic nodes which might face unclean exits.

aelbuni avatar Aug 03 '18 20:08 aelbuni

Agree. There should be some mechanism to reinstate state of blockchain from where node is crashed. Or there will be regular back up cycle who does this job after every 1000 blocks or something.

Just giving my 2 cents.

vimalbera92 avatar Aug 06 '18 09:08 vimalbera92

Agree. Nodeos in my server always stopped and become dirty. Replay it take a long hours each time.

wsdfz avatar Aug 21 '18 00:08 wsdfz

--hard-replay or --replay-blockchain does not work,how to solve this..?

csquan avatar Aug 23 '18 05:08 csquan

after many times fail,do not know what to do.

csquan avatar Aug 23 '18 05:08 csquan

can anyone answer this?

csquan avatar Aug 23 '18 05:08 csquan

when use --replay options,it delete state ,use --hard-replay,it rescontruct,but all this does not make use.is this a bug?

csquan avatar Aug 23 '18 07:08 csquan

none?

csquan avatar Aug 23 '18 07:08 csquan

@cquan What are the symptoms of failure? Paste error logs.

jgiszczak avatar Aug 24 '18 19:08 jgiszczak

@csquan make sure your configuration for state DB size can accommodate the size of the entire blockchain.

In your config.ini file you submit with nodeos command, make sure to increase the size of your state db in MB to a sufficient value:

For instance: chain-state-db-size-mb = 10490 (~=10 GB) # This is not sufficient for the current size of the blockchain

aelbuni avatar Aug 24 '18 20:08 aelbuni

@aelbuni chain-state-db-size-mb in my config.ini is set about 64G,last time is set 8G,and state is above 8G,so nodes abort,is unclean shutdown,then I change to 64G.

csquan avatar Aug 27 '18 02:08 csquan

when add --replay opts,it just been killed.

csquan avatar Aug 27 '18 03:08 csquan

then with no opts,log show “existing block log, attempting to replay 375171 blocks”,after several hours,it just killed.

csquan avatar Aug 27 '18 03:08 csquan

This happens now and again. It interrupts nodeos, and then interrupts DAPPs. Simply replay the blockchain is not a good option, and it takes a long time. Need a solution to make nodeos robust.

mawenpeng avatar Sep 10 '18 05:09 mawenpeng

My server OOM again. It worked fine in several days, and after check the memory logs, it appeared the free mem dropped from 190M to 50M within 15 minutes(That's because it log the memory every 15 minutes). Look like when some codes run, they will eat up all memory in a short time.

[1002343.852391] lowmem_reserve[]: 0 0 13036 13036 [1002343.852394] Node 0 Normal free:55248kB min:55472kB low:69340kB high:83208kB active_anon:13033408kB inactive_anon:228kB active_file:1780kB inactive_file:6696kB unevictable:0kB isolated(anon):0kB isolated(file):148kB present:13631488kB managed:13352544kB mlocked:0kB dirty:0kB writeback:196kB mapped:236kB shmem:468kB slab_reclaimable:75780kB slab_unreclaimable:32784kB kernel_stack:1664kB pagetables:35044kB unstable:0kB bounce:0kB free_pcp:120kB local_pcp:120kB free_cma:0kB writeback_tmp:0kB pages_scanned:13946 all_unreclaimable? yes

wsdfz avatar Sep 11 '18 01:09 wsdfz