Samuel Just [Tue, 4 Sep 2012 20:55:09 +0000 (13:55 -0700)]
OSD::handle_pg_stats_ack: grab pg refcount while processing pg
If the queue refcount is the last one for the pg, the pg->put()
in the loop will destroy the pg while the lock is still held
leading to #3071. Thus, grab refcount in case we need to drop
it.
Samuel Just [Tue, 4 Sep 2012 20:32:58 +0000 (13:32 -0700)]
ReplicatedPG: fill in user log entry last after snapdir tran
The user log entry contains the request id, which will be used
by replay ops to put themselves in the correct place in the
waiting_for_commit/ack maps. Thus, the repop needs to be tagged
with the same version as the log entry with the request id.
Thus, the request id bearing log entry should be the last in
the log entry vector.
This should fix #3072, wherein a replay which should wait on
the repop tagged as version '36 will instead wait on '35.
Samuel Just [Thu, 23 Aug 2012 18:10:25 +0000 (11:10 -0700)]
PG: In Active, don't transition to WantActingChange
want_acting is filled in during recovery completion in
order to move the newly backfilled osd into its correct
place. In this case, however, want_acting must contain
only members of acting and up. Thus, we can be sure that
if any of them go down, we would restart peering anyway.
Thus, we need not transition to WaitActingChange, which
does not reflect that we continue to serve client operations
in the interim.
Sage Weil [Tue, 4 Sep 2012 18:29:21 +0000 (11:29 -0700)]
objecter: fix osdmap wait
When we get a pool_op_reply, we find out which osdmap we need to wait for.
The wait_for_new_map() code was feeding that epoch into
maybe_request_map(), which was feeding it to the monitor with the subscribe
request. However, that epoch is the *start* epoch, not what we want. Fix
this code to always subscribe to what we have (+1), and ensure we keep
asking for more until we catch up to what we know we should eventually
get.
Bug: #3075 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Tommi Virtanen [Tue, 4 Sep 2012 15:20:57 +0000 (08:20 -0700)]
doc: Fix leftover "localhost" mention.
Commit dd011aba90831bade3b67e99268429be10635dce changed
the conf file sample to say {hostname}, but changed the
prose only from ``localhost`` to ``{localhost}``.
Sage Weil [Mon, 3 Sep 2012 21:00:09 +0000 (14:00 -0700)]
msg/Pipe: do not special-case failure during connect
Do not special case failure during connect. In particular, we may be
reconnecting and experience a second fault, and wipe out our session
(e.g., between the fs client and the mds) and destroy important session
state.
This logic dates back to the original patch in '08 when the standby
state was introduced.
Bug: #3070 Signed-off-by: Sage Weil <sage@inktank.com>
Eleanor Cawthon [Fri, 8 Jun 2012 18:05:20 +0000 (11:05 -0700)]
test, key_value_store: added distributed flat btree key-value store
Uses one index object and many sub objects to store key-value pairs. The pairs
are stored in the omaps of librados objects. The index contains keys
corresponding to the highest key in an object, and values that contain the
name of the object where the key range is stored. The tree guarantees that
the number of pairs in an object will be > k and < 2k for a user-specified k.
KvStoreBench contains benchmarking tests.
Sage Weil [Fri, 31 Aug 2012 23:31:01 +0000 (16:31 -0700)]
osd: defer backfill with NOBACKFILL osdmap flag is set
If we encounter nobackfill, let ourselves to fall out of the recovery
queue. If we encounter a map that has does not have the flag set and we
are not clean, requeue ourselves. This is a big hammer, but simple.
Dan Mick [Fri, 31 Aug 2012 22:18:53 +0000 (15:18 -0700)]
Clarify CodingStyle with respect to tab compression of space runs Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Greg Farnum <gregory.farnum@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Dan Mick [Fri, 31 Aug 2012 21:41:29 +0000 (14:41 -0700)]
Fix rados put from '-' (stdin)
Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Mike Ryan <mike.ryan@inktank.com> Reviewed-by: Greg Farnum <gregory.farnum@inktank.com> Fixes: #3068
Samuel Just [Fri, 31 Aug 2012 21:01:47 +0000 (14:01 -0700)]
PG: do not update stats in ReplicaActive from info
Bug #2954
Consider the following case:
1) Primary calls share_pg_info()
2) Primary processes client op and sends off sub_op to replica
3) Replica process sub_op
4) Replica process info reverting stat to before 2)
Similarly:
1) Primary processes client op
2) Primary calls share_pg_info()
3) Replica processes info
[4) Replica processes sub_op]
If 4) is interrupted by a map change, we can end up in a case there
the replica's info has a stat which reflects a log entry which
is not there. If that logs ends up authoratative, the most recent
op will be replayed and end up double counted in the log.
There should actually be no cases where the stats change after the
replica goes active except for as part of a sub_op_modify. Thus,
ReplicaActive::MInfoRec should not update the stats.
CID 716882: Copy-paste error (COPY_PASTE_ERROR)At (2): "last_epoch_started" in
"other.last_epoch_started" looks like a copy-paste error. Should it say
"last_epoch_split" instead?
From what I can tell, this really should be checking other.last_epoch_split
rather than other.last_epoch_started.
Samuel Just [Wed, 29 Aug 2012 23:43:02 +0000 (16:43 -0700)]
osd/Watch.h: uninit var in ctor Watch
CID 717345: Uninitialized pointer field (UNINIT_CTOR)At (8): Non-static class
member "obc" is not initialized in this constructor nor in any functions that
it calls.
At (2): Non-static class member "id" is not initialized in this constructor nor
in any functions that it calls.
At (4): Non-static class member "reply" is not
initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "timeout" is not initialized in this
constructor nor in any functions that it calls.
Samuel Just [Wed, 29 Aug 2012 23:39:25 +0000 (16:39 -0700)]
osd/ReplicatedPG.h: uninit var in ctor RepModify
CID 717344: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "epoch_started" is not initialized in this constructor nor in any
functions that it calls.
Samuel Just [Wed, 29 Aug 2012 23:37:50 +0000 (16:37 -0700)]
osd/ReplicatedPG.h: uninit var in ctor OpContext
CID 717343: Uninitialized pointer field (UNINIT_CTOR)At (3): Non-static class
member "snapset" is not initialized in this constructor nor in any functions
that it calls.
Samuel Just [Wed, 29 Aug 2012 23:32:28 +0000 (16:32 -0700)]
osd/PG.h: uninit var in ctor NamedState
CID 717340: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "state_name" is not initialized in this constructor nor in any functions
that it calls.
Samuel Just [Wed, 29 Aug 2012 23:31:20 +0000 (16:31 -0700)]
osd/PG.h: uninit var in ctor OndiskLog
CID 717342: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "has_checksums" is not initialized in this constructor nor in any
functions that it calls.
Samuel Just [Wed, 29 Aug 2012 23:30:07 +0000 (16:30 -0700)]
osd/PG.h: uninit var in ctor IndexedLog
CID 717339: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "last_requested" is not initialized in this constructor nor in any
functions that it calls.
Samuel Just [Wed, 29 Aug 2012 23:25:20 +0000 (16:25 -0700)]
osd/OpRequest.h: uninit vars in ctor OpRequest
At (2): Non-static class member "hit_flag_points" is not initialized in this
constructor nor in any functions that it calls. CID 717338: Uninitialized
scalar field (UNINIT_CTOR)At (4): Non-static class
member "latest_flag_point" is not initialized in this constructor nor in any
functions that it calls.
Samuel Just [Wed, 29 Aug 2012 23:23:53 +0000 (16:23 -0700)]
osd/OSDMap.cc: uninit vars in ctor struct qi
CID 717337: Uninitialized scalar field (UNINIT_CTOR)At (6): Non-static class
member "weight" is not initialized in this constructor nor in any functions
that it calls.
Samuel Just [Wed, 29 Aug 2012 22:55:23 +0000 (15:55 -0700)]
osd/ClassHandler.cc: uninit var in ctor
CID 717336: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "handler" is not initialized in this constructor nor in any functions
that it calls.
Samuel Just [Wed, 29 Aug 2012 22:53:32 +0000 (15:53 -0700)]
osd/ClassHandler: uninit var in ctor
CID 717335: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "flags" is not initialized in this constructor nor in any functions that
it calls.
Sage Weil [Sat, 25 Aug 2012 23:01:10 +0000 (16:01 -0700)]
monclient: uninit var in ctor
CID 717328: Uninitialized scalar field (UNINIT_CTOR) [select defect]
At (2): Non-static class member "newest" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 22:59:43 +0000 (15:59 -0700)]
mon/MonitorStore: uninit var in ctor
CID 717329: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "lock_fd" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 22:58:57 +0000 (15:58 -0700)]
paxos: init vars in ctr
At (2): Non-static class member "latest_stashed" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "num_last" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "uncommitted_v" is not initialized in this constructor nor in any functions that it calls.
CID 717330: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "uncommitted_pn" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 03:07:20 +0000 (20:07 -0700)]
msg/Accepter: move nonce init to ctor
This was suggested by Greg too but I was too lazy.
CID 717331: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "nonce" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 03:02:14 +0000 (20:02 -0700)]
log: protect m_stop with lock
CID 716965: Data race condition (MISSING_LOCK)
At (2): Accessing "this->m_stop" ("_ZN4ceph3log3LogE.m_stop") requires the "_ZN4ceph3log3LogE.m_queue_mutex" lock.
This isn't strictly needed since we assume only one thread will call this
method and start a thead, but it makes coverity happy.
Sage Weil [Fri, 24 Aug 2012 23:45:29 +0000 (16:45 -0700)]
msg/Accepter: check setsockopt return value
CCID 716856: Other violation (CHECKED_RETURN)
At (7): Calling function "setsockopt(this->listen_sd, 1, 2, &on, 4U)" without checking return value. This library function may fail and return an error code.
Sage Weil [Fri, 24 Aug 2012 23:38:20 +0000 (16:38 -0700)]
mds: fix broken EMetablob inode_t* return value
We pass this back to the caller, but it points to a member that is never
looked at, because the inode has already been encoded. In effect this
wasn't journaling anything useful, and the only user questioned whether it
was needed, so let's rip it out.
Sage Weil [Fri, 24 Aug 2012 23:31:25 +0000 (16:31 -0700)]
client: unconditional teardown
CID 717125: Dereference before null check (REVERSE_INULL)
At (2): Null-checking "this->objectcacher" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.