Skip to content

ObjectStore::Flush() performs deletion, and does not 'flush' any data. #2

Description

@wilson0x4d

Problem

Flush() is incorrectly named and/or incorrectly implemented. I have no way of flushing a critical object to disk without necessarily making all data store on an aggressive time interval. This would be inappropriate.

Expectation

"Flush - (v) To copy data from a temporary storage area such as RAM to a more permanent storage medium such as a disk."

Any ObjectStore::Flush() method should fit the above definition, or should be renamed to convey its actual behavior.

Actual

ObjectStore::Flush() does not perform a flush operation, it performs a purge (it removes all dictionaries from _primaryStore and performs no saves before doing so. If you store an object, call flush, then shutdown the session the resulting .coll and .jnl files are 0 length (empty). This is highly undesirable behavior.

Proposal

ObjectStore::Flush() should instead signal StoreManager::SaveDBThreadMethod() so that the database/collection is stored as one would expect. Right now this method only signals during shutdown, or due to a signal timeout (default appears to be 5 minutes.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions