Thanks for the review Anoop Sam John
So when one snapshot was already in place in MemStore and we again undergo a flush request, now we dont decrease by the begin time memstoreSize. But we check with all MemStores.
Sorry. Having trouble parsing the above. Are you asking a question. Yes, if a snapshot is in place already, and we call flush – we flush the existing snapshot only... that is how this stuff has always worked but our memory accounting did not reflect this... it would subtrace memstore size even though memstore was in place still post flush when existing snapshot.
Now the MemStore returns the previous snapshot's size when one was in place. The snapshot() to MemStore won't take new snaphot when already a snapshot is in place.
Yes. This is how it works. This patch does not change that. This patch just makes our memory accounting align w/ how snapshotting/flush actually works.
....When a flush requested while another was in progress....
Again pardon me for not following.... Only one flush can be going on at a time (you can make a request any time). I am not seeing how we can decrement twice the flush size.
I can add new tests no problem if you can come up with a scenario.