Open tidwall opened 8 years ago
Hi, @tidwall
Because now I'm using TILE38 as fences in and out of the service, this application is run, so I'd like to know, AOFSHRINK not realize cases, is there any reliable way to clear the AOF log.
thanks!
I'm closing this issue and pointing it to #73
I'm reopening this issue and I plan on implementing this feature soon.
@tidwall Any updates on when you would have time to implement this? I could take a swing at it.
I have this mostly working in a private branch for v2, but I have yet to retrofit it into v1.
The logic/rules are pretty straightforward, and if you want to give it a go, I would be happy to go over with you what I have.
When an AOF file gets too large it should automatically shrink. This can be done in a background routine in a similar manner as BuntDB.
https://github.com/tidwall/buntdb/blob/27d3577d74cea0b53b4261365f08a38eff9671be/buntdb.go#L106-L116 https://github.com/tidwall/buntdb/blob/27d3577d74cea0b53b4261365f08a38eff9671be/buntdb.go#L556-L559
Where AutoShrinkPercentage is 100%, and AutoShinkMinSize is 32MB.
This was mentioned in #73. We also needs more unit testing around the AOFSHRINK routine.