[Tech Preview] Hashstore backend for storage nodes

No, It makes those files for everybody but in the current software version the hashstore is not used unless you enable it using the info found in the first post at the top of this thread.

2 Likes

Iā€™ve performed a full migration of my 2.5 TB node (60TB). The previous count of nearly 18,000,000 extremely small files was a major performance bottleneck. This migration has reduced the file count to approximately 2,500, dramatically! improving filesystem performance. Iā€™m hopeful for a smooth transition and the widespread adoption of the hashstore standard.

7 Likes

I wold wait until there is some repear mechanics implemented, but looks promising. even moving this kind of node will be easier in future. bigger files copy work much faster.

12 Likes

Is the garbage collection system fully implemented and working with hashstore? Is there any new logging I should search for to verify functionality on my node?

Yes, itā€™s implemented, itā€™s called compaction.

perhaps, depends on the used version (not all versions have logging). I wouldnā€™t say what you need to search, but try with ā€œhashā€. Itā€™s possible that you need to enable Debug log level.

I have for the storj-up node built from main:

storagenode10-1  | 2025-01-30T01:49:48Z INFO    hashstore       hashstore/store.go:608  beginning compaction    {"Process": "storagenode", "satellite": "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4", "store": "s1", "stats": {"NumLogs":3,"LenLogs":"288.6 MiB","NumLogsTTL":2,"LenLogsTTL":"160.4 MiB","SetPercent":1,"TrashPercent":0,"Compacting":false,"Compactions":0,"TableFull":0,"Today":20118,"LastCompact":0,"LogsRewritten":0,"DataRewritten":"0 B","Table":{"NumSet":18,"LenSet":"288.6 MiB","AvgSet":16814144,"NumTrash":0,"LenTrash":"0 B","AvgTrash":0,"NumSlots":16384,"TableSize":"1.0 MiB","Load":0.0010986328125,"Created":20115},"Compaction":{"Elapsed":0,"Remaining":0,"TotalRecords":0,"ProcessedRecords":0}}}
storagenode10-1  | 2025-01-30T01:49:48Z INFO    hashstore       hashstore/store.go:707  compact once started    {"Process": "storagenode", "satellite": "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4", "store": "s1", "today": 20118}
storagenode10-1  | 2025-01-30T01:49:48Z INFO    hashstore       hashstore/store.go:858  compaction computed details    {"Process": "storagenode", "satellite": "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4", "store": "s1", "nset": 14, "nexist": 18, "modifications": true, "curr logSlots": 14, "next logSlots": 14, "candidates": [3], "rewrite": [3], "duration": "62.945902ms"}
storagenode10-1  | 2025-01-30T01:49:48Z INFO    hashstore       hashstore/store.go:1061 hashtbl rewritten       {"Process": "storagenode", "satellite": "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4", "store": "s1", "total records": 14, "total bytes": "224.5 MiB", "rewritten records": 0, "rewritten bytes": "0 B", "trashed records": 3, "trashed bytes": "48.1 MiB", "restored records": 0, "restored bytes": "0 B", "expired records": 4, "expired bytes": "64.1 MiB"}
storagenode10-1  | 2025-01-30T01:49:48Z INFO    hashstore       hashstore/store.go:709  compact once finished   {"Process": "storagenode", "satellite": "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4", "store": "s1", "duration": "646.935909ms", "completed": true}
storagenode10-1  | 2025-01-30T01:49:48Z INFO    hashstore       hashstore/store.go:610  finished compaction     {"Process": "storagenode", "satellite": "12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4", "store": "s1", "duration": "647.461705ms", "stats": {"NumLogs":2,"LenLogs":"224.5 MiB","NumLogsTTL":1,"LenLogsTTL":"96.2 MiB","SetPercent":1,"TrashPercent":0.21428571428571427,"Compacting":false,"Compactions":0,"TableFull":0,"Today":20118,"LastCompact":20118,"LogsRewritten":1,"DataRewritten":"0 B","Table":{"NumSet":14,"LenSet":"224.5 MiB","AvgSet":16814144,"NumTrash":3,"LenTrash":"48.1 MiB","AvgTrash":16814144,"NumSlots":16384,"TableSize":"1.0 MiB","Load":0.0008544921875,"Created":20118},"Compaction":{"Elapsed":0,"Remaining":0,"TotalRecords":0,"ProcessedRecords":0}}}
1 Like

I started the hashstore migration on a node, on all sats, by setting all those to true and stop/restart the node, and the only logging that I see is the lack of this entrie once at 10 min:

 INFO    piecemigrate:chore      all enqueued for migration; will sleep before next pooling      {"Process": "storagenode", "active": {}, "interval": "10m0s"}

Once I started the migration, this entry is no more.

Funny thing; on the other node on which the migration didnā€™t start, I have a lot of entries regarding compaction, but with 0 values. The nodes are both on 121.2 version.

1 Like

Does your web interface show used space correctly after the migration?

I just finished a full migration on my smallest node and I just saw some errors in my logs. Is this from the badger cache? Perhaps I should disable and remove the badger cache now that there are no more blobs files.

2025-02-01T17:25:17Z    ERROR   blobscache      piecesTotal < 0 {"Process": "storagenode", "piecesTotal": -15360}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesContentSize < 0   {"Process": "storagenode", "piecesContentSize": -14848}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesTotal < 0      {"Process": "storagenode", "satPiecesTotal": -15360}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesContentSize < 0        {"Process": "storagenode", "satPiecesContentSize": -14848}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesTotal < 0 {"Process": "storagenode", "piecesTotal": -1792}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesContentSize < 0   {"Process": "storagenode", "piecesContentSize": -1280}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesTotal < 0      {"Process": "storagenode", "satPiecesTotal": -1792}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesContentSize < 0        {"Process": "storagenode", "satPiecesContentSize": -1280}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesTotal < 0 {"Process": "storagenode", "piecesTotal": -145408}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesContentSize < 0   {"Process": "storagenode", "piecesContentSize": -144896}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesTotal < 0      {"Process": "storagenode", "satPiecesTotal": -145408}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesContentSize < 0        {"Process": "storagenode", "satPiecesContentSize": -144896}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesTotal < 0 {"Process": "storagenode", "piecesTotal": -145408}
2025-02-01T17:25:17Z    ERROR   blobscache      piecesContentSize < 0   {"Process": "storagenode", "piecesContentSize": -144896}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesTotal < 0      {"Process": "storagenode", "satPiecesTotal": -145408}
2025-02-01T17:25:17Z    ERROR   blobscache      satPiecesContentSize < 0        {"Process": "storagenode", "satPiecesContentSize": -144896}

I think thatā€™s because of incorrect used space values. On a nodes with several TB thereā€™s thousands such messages and this happens at the end of migration every satellite

1 Like

It seems I need a used space file walker for hashstore. This is now my dashboard: zero used space.

You should. badger+hashstore dosenā€™t impruve the performance of hashstore alone, but badger takes up RAM. So get rid of it.

1 Like

Just wait new storagenode release, this error has already been corrected. Iā€™ve compiled it for myself from git.

Uploaded linux-x64 storagenode executable to google drive for whos who trusts executables from internet :grin:

3 Likes

Maybe it migrated to someone elseā€™s node? :sweat_smile:
Just kidding. Enable startup piece scan, deactivate badger and lazzy mode, and restart.

Iā€™m on a raspberry pi5 so I compiled an arm64 version. You are correct, This version does work better. But I will probably go went back to a standard release version before storj sends an unmarked van to my house. If these numbers are correct, Iā€™m storing a lot of trash on this node.

I killed the badger but the blobscache errors came back after a restart. Deleting all the databases seems to have made them go away.

Edit: I was wrong. Iā€™m still getting these errors. But fewer of them.

Perhaps itā€™s the TTL system trying to remove expired blobs files that donā€™t exist anymore.

After ending migrate this errors should gone, just relax. You restarted the node and there started other satellite migrate, thatā€™s why you think that problem solved. Now migrating data for this satellite ending and errors shows again.

Migration already ended. This node is tiny. Only has about 100GB. It only has 1 satellite, AP1.

Check that folder ā€œblobsā€ have 0 byte size

It is zero bytes. I think your errors are stopping because you are running the newest software version and your node knows how much data you have. My node thinks I have zero data and it is trying to subtract from zero when it deletes an expired piece resulting in a negative number error. At least that is my theory because the errors appear right after a log line that says ā€œexpired pieces collection startedā€.

1 Like

Itā€™s fixed in main only, itā€™s not released yet.

1 Like