feat: improved go-ds-flatfs (#11092)
* datastore: upgrade go-ds-flatfs to v0.6.0 See: https://github.com/ipfs/go-ds-flatfs/pull/142 * docs(changelog): add go-ds-flatfs atomic batch writes *documents the new flatfs batch implementation that uses atomic operations via temp directory, preventing orphan blocks on interrupted imports and reducing memory usage. * includes improved tests, batch cleanup fixes, and docs * docs(changelog): reframe go-ds-flatfs entry for users focus on user benefits instead of implementation details
Andrew Gillis committed
Jan 13, 2026 at 02:42 UTC
ec973aeb38c7ac28fede7b72a1515a2ee8ff5155
5 files changed
+15
-6
docs/changelogs/v0.40.md
+9
@@ -10,6 +10,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team.
10
11
- [Overview](#overview)
12
- [🔦 Highlights](#-highlights)
13
+ - [🧹 Automatic cleanup of interrupted imports](#-automatic-cleanup-of-interrupted-imports)
14
- [Routing V1 HTTP API now exposed by default](#routing-v1-http-api-now-exposed-by-default)
15
- [Track total size when adding pins](#track-total-size-when-adding-pins)
16
- [🚇 Improved `ipfs p2p` tunnels with foreground mode](#-improved-ipfs-p2p-tunnels-with-foreground-mode)
@@ -24,6 +25,14 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team.
25
26
### 🔦 Highlights
27
28
+#### 🧹 Automatic cleanup of interrupted imports
29
+
30
+If you cancel `ipfs add` or `ipfs dag import` mid-operation, Kubo now automatically cleans up incomplete data on the next daemon start. Previously, interrupted imports would leave orphan blocks in your repository that were difficult to identify and remove without pins and running explicit garbage collection.
31
+
32
+Batch operations also use less memory now. Block data is written to disk immediately rather than held in RAM until the batch commits.
33
+
34
+Under the hood, the block storage layer (flatfs) was rewritten to use atomic batch operations via a temporary staging directory. See [go-ds-flatfs#142](https://github.com/ipfs/go-ds-flatfs/pull/142) for details.
35
+
36
#### Routing V1 HTTP API now exposed by default
37
38
The [Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/) is now exposed by default at `http://127.0.0.1:8080/routing/v1`. This allows light clients in browsers to use Kubo Gateway as a delegated routing backend instead of running a full DHT client. Support for [IPIP-476: Delegated Routing DHT Closest Peers API](https://github.com/ipfs/specs/pull/476) is included. Can be disabled via [`Gateway.ExposeRoutingAPI`](https://github.com/ipfs/kubo/blob/master/docs/config.md#gatewayexposeroutingapi).
docs/examples/kubo-as-a-library/go.mod
+1
-1
@@ -78,7 +78,7 @@ require (
78
github.com/ipfs/go-cidutil v0.1.0 // indirect
79
github.com/ipfs/go-datastore v0.9.0 // indirect
80
github.com/ipfs/go-ds-badger v0.3.4 // indirect
81
- github.com/ipfs/go-ds-flatfs v0.5.5 // indirect
81
+ github.com/ipfs/go-ds-flatfs v0.6.0 // indirect
82
github.com/ipfs/go-ds-leveldb v0.5.2 // indirect
83
github.com/ipfs/go-ds-measure v0.2.2 // indirect
84
github.com/ipfs/go-ds-pebble v0.5.8 // indirect
docs/examples/kubo-as-a-library/go.sum
+2
-2
@@ -288,8 +288,8 @@ github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46U
288
github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk=
289
github.com/ipfs/go-ds-badger v0.3.4 h1:MmqFicftE0KrwMC77WjXTrPuoUxhwyFsjKONSeWrlOo=
290
github.com/ipfs/go-ds-badger v0.3.4/go.mod h1:HfqsKJcNnIr9ZhZ+rkwS1J5PpaWjJjg6Ipmxd7KPfZ8=
291
-github.com/ipfs/go-ds-flatfs v0.5.5 h1:lkx5C99pFBMI7T1sYF7y3v7xIYekNVNMp/95Gm9Y3tY=
292
-github.com/ipfs/go-ds-flatfs v0.5.5/go.mod h1:bM7+m7KFUyv5dp3RBKTr3+OHgZ6h8ydCQkO7tjeO9Z4=
291
+github.com/ipfs/go-ds-flatfs v0.6.0 h1:olAEnDNBK1VMoTRZvfzgo90H5kBP4qIZPpYMtNlBBws=
292
+github.com/ipfs/go-ds-flatfs v0.6.0/go.mod h1:p8a/YhmAFYyuonxDbvuIANlDCgS69uqVv+iH5f8fAxY=
293
github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8=
294
github.com/ipfs/go-ds-leveldb v0.5.2 h1:6nmxlQ2zbp4LCNdJVsmHfs9GP0eylfBNxpmY1csp0x0=
295
github.com/ipfs/go-ds-leveldb v0.5.2/go.mod h1:2fAwmcvD3WoRT72PzEekHBkQmBDhc39DJGoREiuGmYo=
go.mod
+1
-1
@@ -28,7 +28,7 @@ require (
28
github.com/ipfs/go-datastore v0.9.0
29
github.com/ipfs/go-detect-race v0.0.1
30
github.com/ipfs/go-ds-badger v0.3.4
31
- github.com/ipfs/go-ds-flatfs v0.5.5
31
+ github.com/ipfs/go-ds-flatfs v0.6.0
32
github.com/ipfs/go-ds-leveldb v0.5.2
33
github.com/ipfs/go-ds-measure v0.2.2
34
github.com/ipfs/go-ds-pebble v0.5.8
go.sum
+2
-2
@@ -359,8 +359,8 @@ github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46U
359
github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk=
360
github.com/ipfs/go-ds-badger v0.3.4 h1:MmqFicftE0KrwMC77WjXTrPuoUxhwyFsjKONSeWrlOo=
361
github.com/ipfs/go-ds-badger v0.3.4/go.mod h1:HfqsKJcNnIr9ZhZ+rkwS1J5PpaWjJjg6Ipmxd7KPfZ8=
362
-github.com/ipfs/go-ds-flatfs v0.5.5 h1:lkx5C99pFBMI7T1sYF7y3v7xIYekNVNMp/95Gm9Y3tY=
363
-github.com/ipfs/go-ds-flatfs v0.5.5/go.mod h1:bM7+m7KFUyv5dp3RBKTr3+OHgZ6h8ydCQkO7tjeO9Z4=
362
+github.com/ipfs/go-ds-flatfs v0.6.0 h1:olAEnDNBK1VMoTRZvfzgo90H5kBP4qIZPpYMtNlBBws=
363
+github.com/ipfs/go-ds-flatfs v0.6.0/go.mod h1:p8a/YhmAFYyuonxDbvuIANlDCgS69uqVv+iH5f8fAxY=
364
github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8=
365
github.com/ipfs/go-ds-leveldb v0.5.2 h1:6nmxlQ2zbp4LCNdJVsmHfs9GP0eylfBNxpmY1csp0x0=
366
github.com/ipfs/go-ds-leveldb v0.5.2/go.mod h1:2fAwmcvD3WoRT72PzEekHBkQmBDhc39DJGoREiuGmYo=