Re: btrfs thinks fs is full, though 11GB should be still free

Goffredo Baroncelli
2023-12-21T18:03:32Z

On 21/12/2023 14.53, Christoph Anton Mitterer wrote:
> Hey Goffredo.
>
> On Tue, 2023-12-19 at 20:09 +0100, Goffredo Baroncelli wrote:
>> Ok, now we have the case study.
>> To be sure, could you try a defrag (+ sync) of this single file ?
>
> # btrfs filesystem defragment /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
> # btrfs filesystem defragment -t 1000M /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
> # sync
> # btrfs filesystem sync /data/main/
> # compsize /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
> Processed 1 file, 1 regular extents (1 refs), 0 inline.
> Type Perc Disk Usage Uncompressed Referenced
> TOTAL 100% 256M 256M 15M
> none 100% 256M 256M 15M
> #
>
>
>
>> The what is the lsof output ?
>
> # lsof -- /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
> prometheu 2327412 prometheus 12r REG 0,43 15781418 642 /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
> #
>
> I also stopped prometheus synced and checked then:
> # systemctl stop prometheus.service
> # lsof -- /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001

Here you should do a defrag, after the stop of prometheus.

> # btrfs filesystem sync /data/main/
> # compsize /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
> Processed 1 file, 1 regular extents (1 refs), 0 inline.
> Type Perc Disk Usage Uncompressed Referenced
> TOTAL 100% 256M 256M 15M
> none 100% 256M 256M 15M
>
>
>> Does anyone know a way to extract the "owners" of an extent ? I think
>> that
>> we should go through the backref, but I never did. I don't want to
>> re-invent the wheel, so I am asking if someone knows a tool that can
>> help to find the owners of a extent.
>
> Not me ;-) ... Does it help if I'd provide something like dump-tree
> data?
>
I am trying to write a tool that walks the backref to find the owners.
I hope for tomorrow to have a prototype to test.

>
> The fs is soon to be full again, so I'll likely have to delete some of
> the (test) data...
>
>
> Thanks,
> Chris.

--
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5