Commit Graph

24502 Commits

Author SHA1 Message Date
Danny Al-Gaaf
2a94340019 os/FileStore.cc: remove assignment of a never used value
There is no need to set local variable basedir_fd to -1 after
closing and right before leaving the function.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 14:03:27 +01:00
Danny Al-Gaaf
a6f4de924c msg/SimpleMessenger.cc: use static_cast instead of C-Style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 13:45:33 +01:00
Danny Al-Gaaf
637e8e77e5 mon/PGMonitor.cc: use static_cast instead of C-Style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 13:30:04 +01:00
Danny Al-Gaaf
0ed2f377d7 mon/Monitor.cc: Clarify calculation precedence for '%' and '?'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 13:25:41 +01:00
Danny Al-Gaaf
88b6b572d2 librbd/internal.cc: clarify expression with parentheses
From cppcheck:
 [src/librbd/internal.cc:379]: (style) Boolean result is used in
 bitwise operation. Clarify expression with parentheses.
2013-03-11 12:52:44 +01:00
Danny Al-Gaaf
f7eec26a1d SyntheticClient.cc: Clarify calculation precedence for '%' and '?'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 12:25:06 +01:00
Danny Al-Gaaf
94d370e739 fusetrace_ll.cc: reduce scope of 'int err' in main()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 12:13:06 +01:00
Danny Al-Gaaf
5c1dc92951 mds/Locker.cc: fix warning about 'Possible null pointer dereference'
Fix following warning from cppcheck:
 [src/mds/Locker.cc:2255] -> [src/mds/Locker.cc:2258]: (error)
   Possible null pointer dereference: in - otherwise it is redundant
   to check it against null.

Since head_in used for call pick_inode_snap() is already valid,
there is no need to check if 'CInode *in' is not NULL. Remove
not needed check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 12:13:01 +01:00
Danny Al-Gaaf
f971a67c7b mds/Locker.cc: use static_cast instead of C-Style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 12:12:56 +01:00
Sage Weil
494f968aaf Merge remote-tracking branch 'gh/next' 2013-03-08 18:38:32 -08:00
Dan Mick
c7aa897ce0 ceph_common.sh: add warning if 'host' contains dots
This is a common error and there's no reason the script can't
at least tell you it's a really bad idea.  One might argue it
could even successfully proactively truncate the host parameter
at the first dot, but that's a little controlling, perhaps.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-03-08 17:10:11 -08:00
Dan Mick
4fe52a7ff4 Revert "Update conf.py"
This reverts commit 7008992062.
Apparently github's edit lets you commit directly to the repo.
Oops.
2013-03-08 15:46:34 -08:00
Dan Mick
7008992062 Update conf.py 2013-03-08 15:44:28 -08:00
Sage Weil
2c40124bcb Merge pull request #96 from concubidated/master
Fix output of command 'ceph osd tree --format=json'

Reviewed-by: Sage Weil <sage@inktank.com>
2013-03-08 13:49:04 -08:00
John Wilkins
cdb4ae3e06 doc: Added a new network configuration reference document.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-03-08 13:45:04 -08:00
Concubidated
9bcba944c6 Fix output of 'ceph osd tree --format=json'
Signed-off-by: Tyler Brekke <tyler.brekke@inktank.com>
2013-03-08 13:44:39 -08:00
John Wilkins
3854d3ed27 doc: Added network settings. Reorganized index.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-03-08 13:44:31 -08:00
John Wilkins
4c8c36c36b doc: Excised network settings.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-03-08 13:43:44 -08:00
John Wilkins
da706c15d8 doc: Format edits. Excised much of network discussion. Added reference to network guide.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-03-08 13:43:12 -08:00
Samuel Just
31a110c5d0 Merge branch 'wip-osd-map' into next
Fixes: 4369
Backport: bobtail
Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-03-08 12:45:41 -08:00
Sage Weil
881e9d850c osd: mark down connections from old peers
Close out any connection with an old peer.  This avoids a race like:

- peer marked down
- we get map, mark down the con
- they reconnect and try to send us some stuff
- we share our map to tell them they are old and dead, but leave the con
  open
...
- peer marks itself up a few times, eventually reuses the same port
- sends messages on their fresh con
- we discard because of our old con

This could cause a tight reconnect loop, but it is better than wrong
behavior.

Other possible fixes:
 - make addr nonce truly unique (augment pid in nonce)
 - make a smarter 'disposable' msgr state (bleh)

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-08 12:40:36 -08:00
Sage Weil
ba7e815a18 osd/PG: rename require_same_or_newer_map -> is_same_or_newer_map
This avoids confusion with the OSD method of the same name, and better
matches what the function tests (and does not do).

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-08 12:40:36 -08:00
Sage Weil
7a9107d1b8 mon/Paxos: make old clock skew message more/less suggestive
There is a separate clock skew check now, and more often than not this
suggests laggy messages, and not necessarily skew.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-08 10:43:21 -08:00
Yehuda Sadeh
2535e04fce Merge pull request #92 from jaharkes/content_length
Properly format Content-Length: header on 32-bit systems.

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2013-03-08 09:45:44 -08:00
Jan Harkes
416b962c85 Properly format Content-Length: header on 32-bit systems.
- Promote len argument in dump_content_length to uint64_t.
- Make sure there is sufficient scratch space to format string.
- Use PRIu64 macro for formatting.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
2013-03-08 12:28:54 -05:00
Yehuda Sadeh
4384e59ad0 rgw: set attrs on various list bucket xml results (swift)
Fixes: #4247
The list buckets operation was missing some attrs on the different
xml result entities. This fixes it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-03-08 08:31:42 -08:00
Yehuda Sadeh
7cb6ee2807 formatter: add the ability to dump attrs in xml entities
xml entities may have attrs assigned to them. Add the ability
to set them. A usage example:

formatter->open_array_section_with_attrs("container",
     FormatterAttrs("name", "foo", NULL));

This will generate the following xml entity:
<container name="foo">

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-08 08:31:37 -08:00
Yehuda Sadeh
6669e73fa5 rgw: don't iterate through all objects when in namespace
Fixes: #4363
Backport: argonaut, bobtail
When listing objects in namespace don't iterate through all the
objects, only go though the ones that starts with the namespace
prefix

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-03-08 06:55:03 -08:00
Yehuda Sadeh
108063c98f Merge pull request #93 from jaharkes/range_requests
Avoid sending a success response when an error occurs.

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2013-03-08 06:47:00 -08:00
David Zafman
38e55dc574 Merge branch 'wip-2733' 2013-03-07 20:02:04 -08:00
David Zafman
3b260f3dbd Add filestore_replica_fadvise config option default true
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
2013-03-07 20:00:13 -08:00
David Zafman
f52ec6decd osd: fadvise replica data don't use
Add transaction flag indicating if op is at a replica
After write has been sync'ed use posix_fadvise() to clear kernel cache

Feature: #2733

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
2013-03-07 19:36:07 -08:00
Jan Harkes
08d5a283df Avoid sending a success response when an error occurs.
Functions called from RGWGetObj_ObjStore_S3::send_response_data may
change the value of the non-local variable 'ret'. But the response
relies on a local 'req_state' which copies ret at the start of the
function.

Right now none of the called functions actually changes ret so the
problem doesn't trigger, but to avoid future breakage it is safer
to not rely on the (early) copy of the ret variable.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
2013-03-07 22:29:39 -05:00
David Zafman
edd0a1c69f Fix FileStore to notice if filestore_flusher config is changed
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-03-07 17:59:31 -08:00
Sage Weil
de62a79589 Merge branch 'wip-traceless'
Reviewed-by: Greg Farnum <greg@inktank.com>
2013-03-07 17:52:26 -08:00
Sage Weil
eb9b5f074f client: move annoying traceless handling into verify_reply_trace()
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 17:51:57 -08:00
Sage Weil
3f1b7fd590 client: debug async cache invalidation
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 17:51:57 -08:00
Sage Weil
3a7233bc8b mds: pass created_ino back to client on replayed requests
After an MDS restart, the client will resend uncommitted requests.  Use the
information we now have in the session_info_t to pass the created ino
back via the extra_bl payload in the reply.

Fixes: #4034
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 17:51:57 -08:00
Sage Weil
0bcf2ac081 mds: track created inos with completed request ids in session info
Along with each session completed request (tid), also track the created
ino (if any).  This will be used to pass back to the client when they
replay requests in the next patch.

Do not bother making this a backward compatible encoding.  The only
benefit is to allow ceph-mds code to run and then old mds code to run
after it.  Given all of the other incompat changes we *just* made, this
is highly unlikely and not worth the code clutter.  If we had spanned
more releases or a stable release the story would be different.

While we are here, inline the second add_completed_request() method variant
since there is only a single caller and having it overloaded somewhat
obscures what is going on.  This also avoids a duplicate lookup in the
session map in the have_session() check and then in the (old) helper.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 17:51:56 -08:00
Sage Weil
977a1cb257 client: debug created ino
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:42:47 -08:00
Sage Weil
974dc84f6e client: unlink old_dentry on traceless rename reply
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:42:44 -08:00
Sage Weil
bc92b40617 client: force lookup on traceless reply
Call _do_lookup directly so that we avoid hitting the cache

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:46 -08:00
Sage Weil
0d501f6121 client: make _do_lookup take a const string
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:46 -08:00
Sage Weil
31127548bd mds: do not do traceless reply for open O_TRUNC requests
Even though these are "may_write" and may be a mutation, the MDS should not
fake out a traceless reply.  In a real failure, it looks like:

 - mds process request (mutation)
 - mds fails
 - client resends request
 - mds notes that it is O_TRUNC, and already committed, and proceeds with
   a regular open

And that is all fine.

But, that means that if we are trying to simulate this behavior without a
failure, then we should never do a traceless reply on an O_TRUNC request,
because the client will never see such a reply--it'll get a full open
request response instead.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:46 -08:00
Sage Weil
98a383be2e client: handle fh cleanup in ll_create() failure path
Release the fh if we fail the permissions check.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:46 -08:00
Sage Weil
d87035c0c4 client: root can write to any file
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:45 -08:00
Sage Weil
613c8f1edf client: clear I_COMPLETE on traceless reply for dentry request
If a request is against a dentry, and we get a traceless reply, clear
the directory I_COMPLETE flag on the parent directory because we can no
longer trust that our cache is complete.

It is possible we could do something a bit more intelligent here, but it
is not trivial because of racing requests, and traceless replies are
rare, so it's not worth the effort.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:45 -08:00
Sage Weil
80e122f5e8 client: pass ptarget from link, create, mkdir, symlink, setattr
Use the new make_request functionality to ensure that we properly handle
the re-lookup/getattr when we get a traceless reply back from the MDS.

Note that we have to do this on setattr() because ll_getattr() expects to
return the updated inode metadata to the caller.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 16:09:45 -08:00
Sage Weil
29abaf66ad client: handle traceless replies from make_request()
Modify the generic make_request wrapper to retry lookups or getattrs on
requests when the ptarget pointer is specified but there is no trace in
the reply.

Refactor the _create() method to use this, effectively moving all of the
extra_bl code processing into make_request where it is generically
useful.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 15:22:21 -08:00
Sage Weil
1e2864a020 osd: increate default pg log size from 1000 -> 3000
This reduces the probability that we will fail to detect a dup op.  See
#4368.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-07 10:31:27 -08:00