Something is modifying files in trash, preventing deletion

I have an issue with one (possibly more) of my nodes, which is accumulating large amounts of trash that isn’t being cleaned up.

It seems something is modifying the files frequently enough that they are never older than a week, so trash isn’t removed.

Synology is being a little annoying in displaying the birth date of a file, with stat giving the following output.

  File: 2aqasq7f54ks6p4d2ey6khwa5gforhn2hudwlhfwu4mqtlxoza.sj1
  Size: 2304            Blocks: 8          IO Block: 4096   regular file
Device: f905h/63749d    Inode: 448374752   Links: 1
Access: (0600/-rw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-03-01 14:08:04.791610449 +0100
Modify: 2024-03-01 14:08:04.791610449 +0100
Change: 2024-03-01 14:08:04.791085417 +0100
 Birth: -

I tried debugfs to find the info, but it just gets stuck without giving me output. However, when I access the file over SMB from my windows PC, I can see that it’s really old.
image

What could be modifying these files? I’m in the process of migrating this node and would like to clean up the almost 2TB of trash before moving it unnecessarily. Worst case, I won’t migrate the trash and take the risk, but I would rather not do that.

1 Like

Synology interface can show the creation date as well (should have checked there first, I guess). Basically all the trash is ancient on this node.

Do you have lazy filewalker activated?

I believe so. Why would that matter though? It’s also quite pointless as the low priority doesn’t work on Synology.

Edit: I double checked, yes, it’s enabled.

I’m not sure if atime would change when the file was last modified, but maybe it would. In that case each time the node goes over the trash it would be updated.
Can you check if it is enabled? On Synology it looks like it is in Storage Manager > Volume > […] > Settings > Record File Access Time.
Using standard fstab you would have noatime in the mount options to not record file’s last access time.

It’s set to never for a long time already. I didn’t want the constant additional writes. That also should only update the last access time though. Not last modified.

This is interesting. I never really cared about trash size, but my node has about 230GB of it right now.

On my node, the space used by trash goes up and down so it probably works correctly, but I probably should monitor this.

This may already fix the issue, assuming cleanup will just remove the oldest folders, without having to rely on file system timestamps.
https://review.dev.storj.io/c/storj/storj/+/12413

Perhaps Storj Labs was already aware of this possible issue.

I have a feeling this may be a setup specific issue. Not sure though. It didn’t used to happen to this node before either.

1 Like

Interesting… I would take a look tomorow at my nodes. Can you check what happened on 01.03.2024? Node update? DSM update? Package update? Etc? Do you have an antivirus on Syno or on PC that could scan the files modifying some checksum maybe? Check the general logs on DSM and the update schedule. The SMART scan. I can’t tink of anything else at the moment.
It also could be something in the storagenode code.

I’ll check some of those things tomorrow. I have a daily short SMART test scheduled, so that isn’t it. Though an extended test did start on the first. But I’ve noticed this issue before then as well, when it didn’t coincide with the extended SMART test. No antivirus running on the system and I’ve disabled the search indexing service. There hasn’t been a recent DSM update. I don’t think it coincided with a node update, but I’ll check. As far as I can tell there shouldn’t be anything other than the node accessing these files to begin with, let alone modifying them.

Edit: I did notice this comment which might be part of the issue.

But with the planned changes to how trash works, it might not matter anymore.

1 Like

I do not have files older than 7 days in my trash, but I run only 2 nodes in the Docker Desktop for Windows and a one node Windows service.
It could be Synology specific…
Because docker nodes actually Linux nodes.
However, I saw this one:

And if something is modifying the modification time, then my scripts will not detect this…

I have those too. I believe it’s from the new big bloom filter that deletes the old pieces. We all have the same date, so bloom filter is the one sent to all in the same day.
I emptied trash very recently, like a month ago. So before 1.03 there weren’t these files there.

1 Like

I’m assuming that what is shown as “Created Date” is the file’s birth time, as tracked in newer filesystems like ext4. Since these files are moved intact from the blobstore into the trash, the birth time doesn’t change when the file is moved to the trash. So what you see as the created time is probably when the piece was first stored on your node, and not when the piece was put in the trash.

Given that, does it still look like something is updating the mtime on files in the trash?

Have you run any app against the nodes files: maybe something like rsync? (or maybe had the rsync command syncing the wrong way once accidentally?). I don’t know if rsync touches files in a way that would update modification time: I’m just thinking out loud.

Or could a backup program be doing something like that… as a way to detect changes between runs?

For me, this is the oldest node, moved to this drive 2 years ago. noatime, no resync, no backup services running. The machine is dedicated to Storj, no other use, or programs running.

Hi, my nodes have combined 300gb of trash. But I never saw a problem in that, because after a few days it went down to the normal amount. It spikes suddenly and then goes back. So maybe just huge deletion waves?

1 Like