Relationship between Lazy Filewalker and piece-scan-on-startup, explanations of settings

I was reading some of the forums relating to the new Badger DB stuff and saw these two items come up.

Had a couple questions in regards to this, people said that lazy-filewalker setting and piece-scan-on-startup setting are related to eachother, for example piece-scan-on-startup must be disabled for lazy filewalker to work.

I was wondering why this is the case, what the behavior difference is between lazy-filewalker being on or off? I was thinking its only controlling the IO priority of the file walker process, there are no other differences?

What is the piece-scan-on-startup for in this case, is it just an extra scan that is done before starting the node? it seems like the filewalkers still run continuously regardless of this setting.

Additionally, was wondering how the badger cache works, I thought that for the lazy-filewalker we had to continually scan the files to ensure that the metadata/hash matches with what is expected. if we are caching this data, aren’t we loosing the “continual check” aspect of this? What is the TTL on the badger cache, and how much disk IOdoes this actually save?

No. Scan on startup and lazy filewalker can be enabled at the same time.

You cannot enable the badger cacher together with lazy filewalker.

1 Like

Thanks, this was helpful. However it still doesn’t answer my question of what “piece-scan-on-startup” is for, and why would i want to turn that on?

Also, why doesn’t badger cache work with lazy filewalker. And also

What the behavior difference is between lazy-filewalker being on or off? I was thinking its only controlling the IO priority of the file walker process, there are no other differences?

It does:

Calculates disk usage by scanning all pieces and updates the local node databases afterwards with these values

Normally the node should track every upload and deletion sizes and update the nodes databases accordingly. But this does not always work without issues as the database can become corrupted or locked while it wants to update a value. So a full scan is required from time to time have that corrected. This setting enables or disables this scan on every startup.

1 Like