登录
首页 >  Golang >  Go问答

Seaweedfs 删除文件成功,但现有文件管理器仍保留该文件

来源:stackoverflow

时间:2024-04-07 13:27:35 167浏览 收藏

本篇文章向大家介绍《Seaweedfs 删除文件成功,但现有文件管理器仍保留该文件》,主要包括,具有一定的参考价值,需要的朋友可以参考一下。

问题内容

我们使用seaweedfs 1.78

当我使用 grpc 时,通过 filer 删除文件。

curl -x delete http://filer1:9889/dataset/qiantao/1.txt

它返回成功。

因为我有10个文件管理器。删除后!

curl -h "accept: application/json"   "http://filer2:9889/dataset/qiantao/?pretty=y"  |grep qiantao |grep txt 
  % total    % received % xferd  average speed   time    time     time  current
                                 dload  upload   total   spent    left  speed
100 15723    0 15723    0     0  1917k      0 --:--:-- --:--:-- --:--:-- 2193k
      "fullpath": "/dataset/qiantao/1.txt",

如果我启动一个新的文件管理器。

无法获取/dataset/qiantao/1.txt;看起来很完美!!!!

但在现有的文件管理器中。

文件管理器获取下面的文件信息。

curl -h "accept: application/json"   "http://filer1:9889/dataset/qiantao/?pretty=y&limit=1"
{
  "path": "/dataset/qiantao",
  "entries": [
    {
      "fullpath": "/dataset/qiantao/1.txt",
      "mtime": "2020-12-07t11:15:59+08:00",
      "crtime": "2020-12-07t11:15:59+08:00",
      "mode": 432,
      "uid": 0,
      "gid": 0,
      "mime": "text/plain",
      "replication": "010",
      "collection": "",
      "ttlsec": 0,
      "username": "",
      "groupnames": null,
      "symlinktarget": "",
      "md5": null,
      "extended": null,
      "chunks": [
        {
          "file_id": "4328,587fb084df9f9dbf",
          "size": 2,
          "mtime": 1607310959158810676,
          "e_tag": "c7c83966",
          "fid": {
            "volume_id": 4328,
            "file_key": 1484763268,
            "cookie": 3751779775
          }
        }
      ]
    }
  ],
  "limit": 1,
  "lastfilename": "1.txt",
  "shoulddisplayloadmore": true

获取下面的音量信息。

{
      "id": 4328,
      "size": 31492542356,
      "replicaplacement": {
        "samerackcount": 0,
        "diffrackcount": 1,
        "diffdatacentercount": 0
      },
      "ttl": {
        "count": 0,
        "unit": 0
      },
      "collection": "",
      "version": 3,
      "filecount": 111030,
      "deletecount": 709,
      "deletedbytecount": 1628822733,
      "readonly": false,
      "compactrevision": 0,
      "modifiedatsecond": 0,
      "remotestoragename": "",
      "remotestoragekey": ""
    },

因此从卷服务器下载 4328.idx。并使用 see_idx 查找它。

./see_idx -dir /Users/qiantao/Documents/seaweedfs -volumeId=4328 -v=4 |grep 587fb084

key:587fb084 offset:2802901546 size:57
key:587fb084 offset:3937021600 size:4294967295

看起来 key:587fb084 被 new 覆盖了?

那么我该如何解决这个问题,使其看起来正常呢?


解决方案


4294967295是墓碑,标记该条目已被删除。

今天关于《Seaweedfs 删除文件成功,但现有文件管理器仍保留该文件》的内容介绍就到此结束,如果有什么疑问或者建议,可以在golang学习网公众号下多多回复交流;文中若有不正之处,也希望回复留言以告知!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>