Keyvaluestore enhance(backport to firely)
Pulling this into firefly because it doesn't (substantiatively) touch anything outside of KeyValueStore.
Reviewed-by: Sage Weil <sage@inktank.com>
info.last_complete should be the entry before log.complete_to.
This appears to have been a typo introduced in
dd71051a8f.
Signed-off-by: Samuel Just <sam.just@inktank.com>
If there are no deep repairs, we don't want to assert.
Fixes:
-1> 2014-02-21 21:13:56.393087 7f0258ff9700 0 log [INF] : 0.0 repair ok, 0 fixed
0> 2014-02-21 21:13:56.428703 7f0258ff9700 -1 osd/PG.cc: In function 'void PG::scrub_finish()' thread 7f0258ff9700 time 2014-02-21 21:13:56.393127
osd/PG.cc: 4294: FAILED assert(deep_scrub)
Signed-off-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Otherwise, an append preceded by a delete may not see the
correct HashInfo state since it won't have been cached
until the delete is applied.
Fixes: #7506
Signed-off-by: Samuel Just <sam.just@inktank.com>
If we have osdmap N, we want to onetime subscribe
starting at N+1. Among other things, it means we
hear when the NOUP flag is cleared.
This appears to have broken somewhere around
3c76b81f2f.
Fixes: #7511
Signed-off-by: Sage Weil <sage@inktank.com>
The goal of "check_coll" is aimed to ensure the collection is exists. But
the create and delete of collection already ensured by OSD, just remove check.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Before we copy lock implementation from DBObjectMap which provide with two locks
for header. Here just unify it to make ease.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
If the first chunk of object is not read entirely, the current implementation
will contain it entirely which make wrong.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
In some situations, we need to ensure header is held and try to read, so read
interfaces need to accept header argument to allow.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
The perf counter of FileStore can shared with other ObjectStore backend, so move
it to ObjectStore and adjust position to let other KeyValueStore refer to.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Collection is a special object in KeyValueStore, if exists collection modify,
this object will be hold. When exists check collection, it will be dead lock to
try to access this object.
Now lookup transaction cache first to ensure no collection object exists
already.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Copied iterators should be independent of each other, and not
rely on the same underlying ListContext or ObjListCtx.
Add some tests for this to make sure they work in various
circumstances.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
There's no need to destroy it when we've used it once. It'll get destroyed
by the destructor anyway. Now that there's a seek method, we might want seek
and iterate again anyway, which is not possible if the ObjListCtx is gone.
Change get_next() to check the underlying ObjListCtx for the end of iteration
instead of deleting ObjListCtx, and modify the equality operator to count
the end marker (with ctx == NULL) as equal to having a ObjListCtx at the
end of its list.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
ObjectIterator::seek() already calls get_next() to update the
iterator's state. Calling it again goes one past where it should be.
When the iterator reached the end of the list, it deleted the ListCtx,
causing a segfault on further accesses.
Fixes: #7491
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>