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

Hi, what is the simplest way to make messages can be restored when server cut off? #369

Open
luohao123 opened this issue Feb 13, 2024 · 5 comments
Labels
question Further information is requested

Comments

@luohao123
Copy link

Currently the messages that not sent to client yet will be wiped out when server down.

I previous using badge, but that very terriable, causing about 5GB trash don't know what's file to my server, almost make my server bumm out.

Can just make offline message restore be an default behavior? Really need it!

@werbenhu
Copy link
Member

@luohao123 Since most of our developers lack experience using BadgerDB as persistent data in a production environment, take a look at the configuration modifications and the addition of garbage collection described in #370 to see if they would be helpful for your use of BadgerDB.

werbenhu added a commit to werbenhu/mochimqtt that referenced this issue Feb 27, 2024
mochi-co added a commit that referenced this issue Mar 18, 2024
* For issues #370, #369, and #363, add BadgerDB garbage collection.

* Add default configuration for defaultGcInterval.

* Solve DATA RACE.

* Place Badger's configuration in main.go for users to adjust as needed.

* Add TestGcLoop() for coverage.

* Modify GcInterval to shorten test time.

* Add the GcDiscardRatio option for the Badger hook, and include more detailed comments in the example.

---------

Co-authored-by: JB <28275108+mochi-co@users.noreply.github.com>
@werbenhu
Copy link
Member

@luohao123 Could you please check if version v2.6.0 resolves this issue?

@luohao123
Copy link
Author

It's not work , dude.

@werbenhu
Copy link
Member

@luohao123 The latest progress is discussed here: #375

@mochi-co mochi-co added the question Further information is requested label Apr 1, 2024
@werbenhu
Copy link
Member

@luohao123 Could this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants