Skip to content

[feature]: remove useless file system "sync" for boltdb compaction #8502

@C-Otto

Description

@C-Otto

Background

While the database compaction works, writing data to the "temp don't use" file, the updates are written in "sync" mode. For my HDD based ZFS system, this slows down operation quite a lot (it's not worth it to add a SLOG VDEV, as only lnd is using "sync"). Manually disabling "sync" on the filesystem (which one should not do in general!) massively improves the speed of the compaction process.

I believe it's not necessary to sync during compaction, as the data is only used once the whole process completes (running sync at the end might be necessary, though).

Your environment

  • 0.17.3-beta
  • Linux ftp 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
  • v26

Steps to reproduce

Run bbolt compaction on, for example, the watchtower.db file of a watchtower (server).

Expected behaviour

It's fast.

Actual behaviour

It's slow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions