lotus/node
Hector Sanjuan fa93c23813 Chain ranged export: rework and address current shortcomings
This commit moderately refactors the ranged export code. It addresses several
problems:
  * Code does not finish cleanly and things hang on ctrl-c
  * Same block is read multiple times in a row (artificially increasing cached
    blockstore metrics to 50%)
  * It is unclear whether there are additional races (a single worker quits
    when reaching height 0)
  * CARs produced have duplicated blocks (~400k for an 80M-blocks CAR or
    so). Some blocks appear up to 5 times.
  * Using pointers for tasks where it is not necessary.

The changes:

  * Use a FIFO instead of stack: simpler implementation as its own type. This
has not proven to be much more memory-friendly, but it has not made things
worse either.
  * We avoid a probably not small amount of allocations by not using
    unnecessary pointers.
  * Fix duplicated blocks by atomically checking+adding to CID set.
  * Context-termination now works correctly. Worker lifetime is correctly tracked and all channels
  are closed, avoiding any memory leaks and deadlocks.
  * We ensure all work is finished before finishing, something that might have
  been broken in some edge cases previously. In practice, we would not have
  seen this except perhaps in very early snapshots close to genesis.

Initial testing shows the code is currently about 5% faster. Resulting
snapshots do not have duplicates so they are a bit smaller. We have manually
verified that no CID is lost versus previous results, with both old and recent
snapshots.
2023-02-14 21:08:10 +01:00
..
bundle introduce v9 actors and nv17 2022-09-09 21:40:15 -04:00
config remove extra event doc 2023-01-19 19:53:21 -05:00
hello fix: error checks 2023-01-04 20:10:21 +08:00
impl Chain ranged export: rework and address current shortcomings 2023-02-14 21:08:10 +01:00
modules Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-10 18:39:51 -05:00
repo Merge pull request #9973 from placer14/mg/chore/expose-compaction-poolsize-envvar 2023-02-10 11:38:08 +01:00
builder_chain.go Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-03 09:27:04 -05:00
builder_miner.go Upgrade to index-provider 0.10.0 2023-01-10 13:08:04 +00:00
builder.go Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-03 09:27:04 -05:00
fxlog.go chore: fix imports 2022-06-14 17:00:51 +02:00
health.go Don't use go-libp2p-core 2022-08-25 14:20:41 -04:00
options.go fix linter 2022-10-14 11:23:05 +02:00
rpc.go fix: should not serve non v0 api in v1 2023-01-31 17:06:02 -05:00
shutdown_test.go fix make gen 2022-08-29 16:25:30 +02:00
shutdown.go Set notifications for SIGTERM and SIGINT when we start the cli 2022-12-15 12:54:41 -05:00
testopts.go enable libp2p options 2021-06-30 12:55:43 +02:00