Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Closed
hyqsfaf opened this issue Jul 19, 2018 · 34 comments
Closed
Assignees
Labels

Comments

@hyqsfaf
Copy link

hyqsfaf commented Jul 19, 2018

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

@taokayan
Copy link
Contributor

please use --hard-replay

@lcgogo
Copy link
Contributor

lcgogo commented Jul 19, 2018

You can relpay the chain with "--replay-blockchain --hard-replay-blockchain" when start the eos like the comments in #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 #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.

@ridewindx
Copy link

ridewindx commented Jul 19, 2018

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.

@jgiszczak
Copy link
Contributor

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.

@bitrocks
Copy link

bitrocks commented Jul 20, 2018

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?

@aelbuni
Copy link

aelbuni commented Aug 3, 2018

@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.

@vimalbera92
Copy link

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.

@wsdfz
Copy link

wsdfz commented Aug 21, 2018

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

@csquan
Copy link

csquan commented Aug 23, 2018

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

@csquan
Copy link

csquan commented Aug 23, 2018

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

@csquan
Copy link

csquan commented Aug 23, 2018

can anyone answer this?

@csquan
Copy link

csquan commented Aug 23, 2018

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

@csquan
Copy link

csquan commented Aug 23, 2018

none?

@jgiszczak
Copy link
Contributor

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

@aelbuni
Copy link

aelbuni commented Aug 24, 2018

@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

@csquan
Copy link

csquan commented Aug 27, 2018

@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
Copy link

csquan commented Aug 27, 2018

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

@csquan
Copy link

csquan commented Aug 27, 2018

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

@mawenpeng
Copy link
Contributor

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.

@wsdfz
Copy link

wsdfz commented Sep 11, 2018

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

@mawenpeng
Copy link
Contributor

Most of the time, the replay fails after hours, I have to clean up the data directory and restart from the scratch.

@brandedux
Copy link

brandedux commented Oct 19, 2018

Albeit a truly unacceptable solution --delete-all-blocks. It's fast, haha.

Before replaying and / or deleting. Make sure you check your ports and kill all related processes. I have found this usually enables me restart nodeos.
Find associated nodeos PID lsof -i
Replace PID with the PID number associated with nodeos pkill PID

@beykery
Copy link

beykery commented Oct 22, 2018

@vimalbera92 Agree .

@oslivan
Copy link

oslivan commented Oct 23, 2018

After 11 hour, replay is not finished.

@halsaphi
Copy link
Contributor

halsaphi commented Nov 1, 2018

Closed as refers to old version of code.
Please refer to latest code and documentation:
https://github.com/EOSIO
https://developers.eos.io/
If problem persists with latest version please raise new issue.

@halsaphi halsaphi closed this as completed Nov 1, 2018
@Yucheng123
Copy link

After 3 days ,hard-replay is not finished

@oslivan
Copy link

oslivan commented Dec 25, 2018

You can see which block is currently being replayed in the log. It took me 4~5 days to replay it.

@Yucheng123
Copy link

after version 1.4,eos has no need to replay,snapshot instead url: #5956:

@matthewdarwin
Copy link

If you want the full history, then you still need to replay.

@matthewdarwin
Copy link

I recommend to take regular backups (daily) in case it gets corrupted.

@mhinc14
Copy link

mhinc14 commented Apr 19, 2019

For anyone following the tutorial on developers.eos.io the above solution worked for me. I did the following `nodeos -e -p eosio
--plugin eosio::producer_plugin
--plugin eosio::chain_api_plugin
--plugin eosio::http_plugin
--plugin eosio::history_plugin
--plugin eosio::history_api_plugin
--access-control-allow-origin='*'
--contracts-console
--http-validate-host=false
--verbose-http-errors
--replay-blockchain
--hard-replay-blockchain

nodeos.log 2>&1 &`

@mosjin
Copy link

mosjin commented Jun 9, 2019

@mhinc14 Juse like your ideas, I used command below, and it works.
My box is CentOS7.6 with recent eos github codes.

nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false

@rahulbhangre
Copy link

i want to start all process again how i can delet everything and start again?

@matthewdarwin
Copy link

add "--delete-all-blocks" to your command.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests