Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: periodically saving collection bloats db storage size #79

Closed
edwinkys opened this issue Apr 26, 2024 Discussed in #77 · 1 comment · Fixed by #84 or #85
Closed

BUG: periodically saving collection bloats db storage size #79

edwinkys opened this issue Apr 26, 2024 Discussed in #77 · 1 comment · Fixed by #84 or #85
Assignees
Labels
bug Something isn't working

Comments

@edwinkys
Copy link
Member

Description

This bug happens when saving a collection in a periodic manner like the example below.

# Create the DB and collection...
for _ in range(300):
    records = Record.many_random(dimension=512, len=100)
    collection.insert_many(records)
    db.save_collection("storage", collection)

This caused unflushed dirty IO buffers to bloats the database folder to an amount unimaginable 🤯
From 70MB database size to 10GB.

Read the discussion #77 for more context about what is happening.

@edwinkys edwinkys added the bug Something isn't working label Apr 26, 2024
@edwinkys edwinkys self-assigned this Apr 26, 2024
@edwinkys edwinkys linked a pull request May 4, 2024 that will close this issue
4 tasks
@edwinkys
Copy link
Member Author

edwinkys commented May 6, 2024

The methods added in #84, Database.flush and Database.async_flush don't solve this issue. It seems that the correct approach to fix this issue is to store the collection in it's own file and only use Sled to store the reference to the file.

@edwinkys edwinkys reopened this May 6, 2024
@edwinkys edwinkys linked a pull request May 17, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant