Skip to content

Index.v ~readonly:true creates paths if store does not exist #395

Open
@metanivek

Description

@metanivek

When opening an index as read-only for a new store (eg Index.v ~readonly:true ~log_size "./new-index") the paths "./new-index" and "./new-index/index" are created on disk and a usable, but empty, index value is returned. If ~fresh:true is passed, however, an exception is raised.

It is unexpected for a read-only instance to create anything on disk. The ideal behavior would be for index to either disallow opening an index as read-only if it does not exist (perhaps raise the same exception) or support empty read-only instances -- like the current behavior -- but that have no backing on disk. The second option would be the least disruptive to existing clients that might depend on the current non-exception raising behavior.

As reported by @vect0r-vicall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions