Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain when reindex-chainstate can be used instead of reindex #13662

Merged
merged 1 commit into from Sep 7, 2018

Conversation

Projects
None yet
4 participants
@Sjors
Copy link
Member

commented Jul 14, 2018

Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711

@Sjors Sjors force-pushed the Sjors:2018/07/reindex-chainstate-doc branch Jul 14, 2018

@fanquake fanquake added the Docs label Jul 14, 2018

src/init.cpp Outdated
@@ -384,7 +384,7 @@ void SetupServerArgs()
"Warning: Reverting this setting requires re-downloading the entire blockchain. "
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. Only necessary in pruning mode or if blocks on disk might be corrupted.", false, OptionsCategory::OPTIONS);

This comment has been minimized.

Copy link
@MarcoFalke

MarcoFalke Jul 14, 2018

Member

If the blocks on disk are corrupted, you should do a "full" reindex, not rebuild the chainstate.

This comment has been minimized.

Copy link
@Sjors

Sjors Jul 14, 2018

Author Member

Oops, I got the comment the wrong way around.

@Sjors Sjors force-pushed the Sjors:2018/07/reindex-chainstate-doc branch to 65a449f Jul 14, 2018

@@ -384,7 +384,7 @@ void SetupServerArgs()
"Warning: Reverting this setting requires re-downloading the entire blockchain. "
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead.", false, OptionsCategory::OPTIONS);

This comment has been minimized.

Copy link
@MarcoFalke

MarcoFalke Jul 14, 2018

Member

I believe it will automatically prompt you to use -reindex when needed while in pruning mode, so maybe no need to mention it here?

Then, you could move the note about corruption to reindex. E.g. "Rebuild chain state and block index from the blk*.dat files on disk . Only needed when blocks on disk are corrupted. "

This comment has been minimized.

Copy link
@Sjors

Sjors Jul 16, 2018

Author Member

I just sabotaged a pruned node by deleting the most recent blkxxxxx.dat file and then started bitcoind: Please restart with -reindex or -reindex-chainstate to recover.

Restarting that pruned node with -reindex-chainstate will result in the same error message and won't tell the user they need to use -reindex instead. So I think it's better to mention pruned node in the help here.

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Jul 14, 2018

Concept ACK

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Sep 7, 2018

utACK 65a449f

@MarcoFalke MarcoFalke merged commit 65a449f into bitcoin:master Sep 7, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

MarcoFalke added a commit that referenced this pull request Sep 7, 2018

Merge #13662: Explain when reindex-chainstate can be used instead of …
…reindex

65a449f Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost)

Pull request description:

  Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711

Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1

@Sjors Sjors deleted the Sjors:2018/07/reindex-chainstate-doc branch Sep 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.