Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.11.0-rc1 underreports RepoSize significantly #8579

Closed
3 tasks done
ylempereur opened this issue Dec 2, 2021 · 3 comments · Fixed by #8581
Closed
3 tasks done

v0.11.0-rc1 underreports RepoSize significantly #8579

ylempereur opened this issue Dec 2, 2021 · 3 comments · Fixed by #8581
Assignees
Labels
effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws)
Milestone

Comments

@ylempereur
Copy link

Checklist

Installation method

ipfs-update or dist.ipfs.io

Version

go-ipfs version: 0.11.0-rc1
Repo version: 11
System version: amd64/darwin
Golang version: go1.16.8

Config

I only included the relevant part:

  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "10GB"
  },

Description

My datastore contained over 2GB before I switched to the latest binary (and was reporting it correctly in v0.10.0), it now reports around 230MB (in repo stat and webui).

I have run some tests and the pinned data is still there and reachable. Adding and removing data (using add, pin rm and repo gc) do not appear to alter the reported repo size (while the data becomes reachable after add and unreachable after gc).

My install is mostly default, with the exception that I'm using the AcceleratedDHTClient.

➜  ~ du -hd0 .ipfs/blocks
2.2G	.ipfs/blocks
➜  ~ ipfs repo stat
NumObjects: 30360
RepoSize:   242893065
StorageMax: 10000000000
RepoPath:   /Users/yves/.ipfs
Version:    fs-repo@11
➜  ~ ipfs stats provide
TotalProvides:          60k (60,715)
AvgProvideDuration:     13.121ms
LastReprovideDuration:  8m41.179902s
LastReprovideBatchSize: 30k (30,360)

Please advise.

@ylempereur ylempereur added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Dec 2, 2021
@aschmahmann
Copy link
Contributor

Thanks for the report. It looks like a function got missed as part of #6803 (i.e. https://github.com/ipfs/go-ds-flatfs/blob/27a1f1eee3538be7ff43b7f1a5c73122427738fb/flatfs.go#L1094).

@guseggert could you take a look through the other datastores to:

  1. Add interface checks for the interfaces a given datastore struct should/does implement
  2. Fix the errors

This is going to look like ipfs/go-datastore#184.

I'd definitely check out FlatFS, Badger (1+2) and S3 datastores as those are the mostly commonly used ones.

@aschmahmann aschmahmann added effort/hours Estimated to take one or several hours and removed need/triage Needs initial labeling and prioritization labels Dec 3, 2021
@aschmahmann aschmahmann mentioned this issue Dec 3, 2021
80 tasks
@BigLep BigLep added this to the go-ipfs 0.11 milestone Dec 3, 2021
guseggert added a commit that referenced this issue Dec 3, 2021
aschmahmann pushed a commit that referenced this issue Dec 3, 2021
aschmahmann pushed a commit that referenced this issue Dec 3, 2021
Fixes #8579

(cherry picked from commit 024e84a)
aschmahmann pushed a commit that referenced this issue Dec 3, 2021
Fixes #8579

(cherry picked from commit 024e84a)
guseggert added a commit that referenced this issue Dec 3, 2021
Fixes #8579

(cherry picked from commit 024e84a)
@guseggert
Copy link
Contributor

@ylempereur Could you upgrade to RC2 and verify that it fixes this issue for you? https://github.com/ipfs/go-ipfs/releases/tag/v0.11.0-rc2

@ylempereur
Copy link
Author

@guseggert That did it! the correct size is now being reported when using rc2.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants