A quick and simple fix for #RavenDB-1445
Helps if we actually change the code we meant to change
Merged from upstream
Okay, so we'll do it on idle and maintain an in-memory copy of that info, now my stale check won't work
Removed the overload for storage checking on staleness, and added a convenience method to DocumentDatabase to get me a cutoff etag for a given index
Read from in-memory etags when doing checks on query
Flush collection etags on shutdown
Write the last etag we saw as part of collection etags
Start-up logic to do a seek if we haven't got all the collection etags in memory
And this is why we run the tests
Fail gracefully if we haven't got an etag for a collection yet - this could happen when migrating versions
REad the etags as strings and parse them, or we (occasionally???) get errors
Make sure to delete the file before hand
Silly mistake - it helps if 'all' actually means 'all'
Moved the last collection etags stuff out into a class so I can test it and demonstrate it actually works
Made the collection etags a bit more bulletproof, just in case we end up with an ininite loop for some unknown reason
Fixed a regression added in commit #16a6612d
Safely dispose