The fd cache only works correctly when there is at most 1
inode per hobject_t. This condition is frequently violated
during replay.
Fixes: #5699
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
For swift we're setting the location constraint to be the
current region we're in when creating a bucket.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
When forwarding a swift request to a different region, we
need to use the effective uri, and not just send the one
we got since we use S3 authentication for the forwarded
requests. This is achieved through a new using 'effective_uri'
param on the request info (which in swift ponts to the
plain bucket/object uri without the swift/v1 prefix(.
Also, rename the old req_state::effective_uri to relative_uri
in order to prevent confusion.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Currently doing it only when copying between regions. This is
needed so that the operation doesn't time out (as it can take
a long time and the web server may just hang on us since we're
not sending any data).
This is configurable and can be disabled. Currently only implemented
for S3.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
During the collect/last exchange, peers share any uncommitted values
with the leader. They are supposed to also share the pn under which
that value was accepted, but were instead using the just-accepted pn
value. This effectively meant that we *always* took the uncommitted
value; if there were multiples, which one we accepted depended on what
order the LAST messages arrived, not which pn the values were generated
under.
The specific failure sequence I observed:
- collect
- learned uncommitted value for 262 from myself
- send collect with pn 901
- got last with pn 901 (incorrect) for 200 (old) from peer
- discard our own value, remember the other
- finish collect phase
- ignore old uncommitted value
Fix this by storing a pending_v and pending_pn value whenever we accept
a value. Use this to send an appropriate pn value in the LAST reply
so that the leader can make it's decision about which uncommitted value
to accept based on accurate information. Also use it when we learn
the uncommitted value from ourselves.
We could probably be more clever about storing less information here,
for example by omitting pending_v and clearing pending_pn at the
appropriate point, but that would be more fragile. Similarly, we could
store a pn for *every* commit if we wanted to lay some groundwork for
having multiple uncommitted proposals in flight, but I don't want to
speculate about what is necessary or sufficient for a correct solution
there.
Fixes: #5698
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
If an older peer sends an uncommitted value, make sure we only take it
if it is in the future, and at least as new as any current uncommitted
value.
(Prior to the previous patch, peers could send values from long-past
rounds. The pn values are also bogus.)
Signed-off-by: Sage Weil <sage@inktank.com>
We may have an uncommitted value from our perspective (it is our lc + 1)
when the collector has a much larger lc (because we have been out for
the last few rounds). Only share an uncommitted value if it is in fact
the next value.
Signed-off-by: Sage Weil <sage@inktank.com>
From the man page for posix_fallocate:
posix_fallocate() returns zero on success, or an error
number on failure. Note that errno is not set.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
The osd lock is not held at this point, we must use
the createmap passed in.
Fixes: #5656
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Some callbacks take the osd lock, so we need to avoid blocking an
osd lock holding thread while waiting on a filestore callback.
Instead, just queue the transaction, and allow _try_resurrect_pg
to cancel us while we are waiting for the transaction to go through
(CLEARING_WAITING).
Fixes: #5672
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Fixes: #5691
We need to also read the attributes, as bucket might be a legacy
bucket and might have all bucket instance info in that object.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Tested-by: Faidon Liambotis <faidon@wikimedia.org>
CID 1049213 (#3 of 3): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "rop" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1049214 (#13 of 13): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "op" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1049215 (#12 of 12): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "rop" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix some more cases where resource wasn't deleted/freed before
call new().
CID 1049216 (#1-9 of 9): Resource leak (RESOURCE_LEAK)
overwrite_var: Overwriting "op" in "op = new_op()" leaks
the storage that "op" points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1049217 (#1 of 1): Resource leak (RESOURCE_LEAK)
overwrite_var: Overwriting "op" in "op = new_op()" leaks
the storage that "op" points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1049219 (#17 of 17): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "op" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1049220 (#18 of 18): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "rop" going out of scope leaks
the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for coverity issue:
CID 1049231 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value "start_key_added".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
The ac_check_func fails because -lfuse is not in LIBS. This also enables
code that wasn't being compiled, and fixes compiler errors that
resulted.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>