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

@Sjors
Copy link
Member

@Sjors Sjors commented Jul 14, 2018

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

@Sjors Sjors force-pushed the 2018/07/reindex-chainstate-doc branch from e55f03f to 6c53e46 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);
Copy link
Member

@MarcoFalke MarcoFalke Jul 14, 2018

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

Copy link
Member Author

@Sjors Sjors Jul 14, 2018

Oops, I got the comment the wrong way around.

@Sjors Sjors force-pushed the 2018/07/reindex-chainstate-doc branch from 6c53e46 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);
Copy link
Member

@MarcoFalke MarcoFalke Jul 14, 2018

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

Copy link
Member Author

@Sjors Sjors Jul 16, 2018

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

@MarcoFalke MarcoFalke commented Jul 14, 2018

Concept ACK

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Sep 7, 2018

utACK 65a449f

@MarcoFalke MarcoFalke merged commit 65a449f into bitcoin:master Sep 7, 2018
1 check passed
MarcoFalke added a commit that referenced this issue Sep 7, 2018
…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 2018/07/reindex-chainstate-doc branch Sep 7, 2018
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Dec 20, 2019
…reindex

Summary:
65a449f8e3 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

Backport of Core PR13662
bitcoin/bitcoin#13662

Test Plan:
  make check
  ./bitcoind --help
Verify help test for `-reindex-chainstate`.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4741
jonspock added a commit to jonspock/devault that referenced this issue Oct 2, 2020
…reindex

Summary:
65a449f8e3 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

Backport of Core PR13662
bitcoin/bitcoin#13662

Test Plan:
  make check
  ./bitcoind --help
Verify help test for `-reindex-chainstate`.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4741
jonspock added a commit to jonspock/devault that referenced this issue Oct 5, 2020
…reindex

Summary:
65a449f8e3 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

Backport of Core PR13662
bitcoin/bitcoin#13662

Test Plan:
  make check
  ./bitcoind --help
Verify help test for `-reindex-chainstate`.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4741
jonspock added a commit to devaultcrypto/devault that referenced this issue Oct 10, 2020
…reindex

Summary:
65a449f8e3 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

Backport of Core PR13662
bitcoin/bitcoin#13662

Test Plan:
  make check
  ./bitcoind --help
Verify help test for `-reindex-chainstate`.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4741
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 19, 2021
…ead 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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 19, 2021
…ead 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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 19, 2021
…ead 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
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 19, 2021
…ead 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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants