Skip to content

[Enhancement]: Defer the unlink operation until after munmap #41636

@czs007

Description

@czs007

Is there an existing issue for this?

  • I have searched the existing issues

What would you like to be added?

In our current approach, to bind the file object with the process lifecycle, we unlink the file immediately after mmap. This makes the file invisible to the file system and hinders precise disk usage tracking. It is advisable to defer the unlink operation until after munmap.

When a segment object or index is destroyed, we execute munmap, unlink(filepath), and close(fd). Even if these operations fail, we depend on startup cleanup or hook-based cleanup as a fallback.

Why is this needed?

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

kind/enhancementIssues or changes related to enhancementstaleindicates no udpates for 30 days

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions