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

Hot command for reclaim disk #30

Closed
shortthefomo opened this issue Oct 14, 2022 · 3 comments
Closed

Hot command for reclaim disk #30

shortthefomo opened this issue Oct 14, 2022 · 3 comments

Comments

@shortthefomo
Copy link
Contributor

Looking for a command to reclaim disk from Hermes.

@pkcs8
Copy link
Member

pkcs8 commented Oct 14, 2022

Hi @lathanbritz,

If you can still connect to mongodb, can you please try this and let me know if it helped?

$ mongosh
test> use hermes_dev
switched to db hermes_dev
hermes_dev> db.validations.deleteMany({ledger_index: {$lt: 75000000}})
{ acknowledged: true, deletedCount: 3981200 }
hermes_dev> db.runCommand({ compact: 'validations' }) 
{ bytesFreed: 1493123072, ok: 1 }
hermes_dev> 

This should delete all validations prior to ledger number 75000000. I will add a PR to Hermes so it does this automatically at user configurable intervals.

@pkcs8
Copy link
Member

pkcs8 commented Feb 7, 2023

online_delete support added to the main branch 59666e7. This would be available in a release soon.

@pkcs8
Copy link
Member

pkcs8 commented Feb 7, 2023

Added a hot command to reclaim disk space in commit a816ff7

$ npm run online-delete compact
[online-delete] Compact validations collection: 3.65 MB freed

@pkcs8 pkcs8 closed this as completed Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants