You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2024/03/06 07:37:18 UTC

Re: [I] docker部署1.2.0内置rocksdb版本在磁盘满了之后未自动清理 [incubator-hugegraph]

dosubot[bot] commented on issue #2474:
URL: https://github.com/apache/incubator-hugegraph/issues/2474#issuecomment-1980255050

   <!-- Greeting -->
   嗨,@ycycyccc!很高兴再次见到你在这里提问🌀
   
   <!-- Answer -->
   根据您提供的信息,我注意到您在使用RocksDB作为后端存储,并且已经为顶点和边设置了TTL(生存时间)。然而,您遇到的问题是,即使在停止写入几天后,磁盘空间仍未被自动清理。
   
   在RocksDB中,TTL支持并不是通过`SstFileWriter`或类似的类来管理的。相反,TTL管理通常需要显式处理,要么通过应用逻辑定期删除过期的条目,要么通过RocksDB在某些配置中的内置TTL支持。在您提供的代码片段中,并没有显示出这样的处理。
   
   因此,Docker部署的incubator-hugegraph版本1.2.0在设置了顶点和边的TTL后,磁盘空间仍未被自动清理,这可能是由于在提供的RocksDB会话管理代码中,没有实现基于TTL的删除或清理逻辑。没有这样的逻辑,仅设置TTL值是不会导致自动数据删除或磁盘空间清理的。
   
   关于TTL值的设置,incubator-hugegraph代码库中,顶点的TTL值是通过`VertexLabelBuilder`类设置的,具体使用的是`ttl(long ttl)`方法。这个方法将TTL值分配给`VertexLabelBuilder`实例的`ttl`字段。当使用`build()`或`create()`方法构建或创建顶点标签时,这个TTL值就会被应用到正在构造的顶点标签上。
   
   对于边,虽然提供的上下文没有直接显示设置边的TTL的代码,但是过程通常是类似的,涉及到一个边标签构建器类,有一个设置TTL值的方法,然后在构建或创建边标签时应用。
   
   如果您需要进一步的帮助,或者有其他的问题,欢迎继续提问。
   
   ## Sources
   - [hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdbsst/RocksDBSstSessions.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdbsst/RocksDBSstSessions.java)
   - [hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/VertexLabelBuilder.java)
   
   <!-- Dosu Comment Footer -->
   <details open>
   <summary>
   
   #### About Dosu
   </summary>
   
   This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
   
   If you want to continue the conversation, start your reply with @dosu-bot.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org