Sage Weil [Fri, 17 Aug 2012 19:10:05 +0000 (12:10 -0700)]
librbd: hide ENOENT on discard
AioZero, Truncate, and Remove are only used by discard and resize
operations where ENOENT can be safely ignored. If that changes in the
future, we'll need to move the enoent flag setting into discard explicitly.
Fixes: #2958 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Thu, 16 Aug 2012 23:55:32 +0000 (16:55 -0700)]
osd: avoid dereferencing pg info without lock
The gen_prefix() is used for debug prefixes, but traverses data structures
that can be modified when the lock is held. Only include them in the
prefix if the lock is held; otherwise print an abbreviated prefix that is
similarly greppable to the normal output.
Fixes: #2957 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Tommi Virtanen [Thu, 16 Aug 2012 23:35:30 +0000 (16:35 -0700)]
run-cli-tests: Check that virtualenv is found.
Commit 343cc792e847ca8901f6c08e41799a2fbbd2ca92 switched us from pip
-E to virtualenv, to keep up with the Python ecosystem, but left in
this old check for existence of "pip" as a command. We don't strictly
need that; what we need is a "virtualenv" command. PIP will be
available inside the virtualenv, by the time we get around to running
it. Check for virtualenv instead.
Sage Weil [Thu, 16 Aug 2012 21:34:01 +0000 (14:34 -0700)]
SyntheticClient: fix warnings
client/SyntheticClient.cc: In member function 'int SyntheticClient::play_trace(Trace&, std::string&, bool)':
client/SyntheticClient.cc:1494:22: warning: ordered comparison of pointer with integer zero [-Wextra]
CXX rados_sync.o
client/SyntheticClient.cc:1500:22: warning: ordered comparison of pointer with integer zero [-Wextra]
Sage Weil [Thu, 16 Aug 2012 00:48:06 +0000 (17:48 -0700)]
librbd: fix uninit var new_snap in ictrx_refresh()
Valgrind picked this up:
==22755== Conditional jump or move depends on uninitialised value(s)
==22755== at 0x4EC2A11: librbd::ictx_refresh(librbd::ImageCtx*) (internal.cc:1384)
==22755== by 0x4EC10F7: librbd::ictx_check(librbd::ImageCtx*) (internal.cc:1212)
==22755== by 0x4EBD246: librbd::info(librbd::ImageCtx*, rbd_image_info_t&, unsigned long) (internal.cc:841)
==22755== by 0x4E9D71A: rbd_stat (librbd.cc:584)
==22755== by 0x4039A5: check_trunc_hack (fsx.c:477)
==22755== by 0x4060FA: main (fsx.c:1508)
Sage Weil [Thu, 16 Aug 2012 21:27:35 +0000 (14:27 -0700)]
librbd: fix warning
librbd/internal.cc: In function 'int librbd::ictx_refresh(librbd::ImageCtx*)':
librbd/internal.cc:1334:59: warning: enumeral and non-enumeral type in conditional expression [enabled by default]
Cap the number of maps we delete on each pass through handle_osd_map. As
long as the target transaction size is larger than the number of maps we
get in each message, we'll be fine. Ensure we at least keep pace with
incoming maps in case those values' relative sizes nave flipped.
Fixes: #2856 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Wed, 25 Jul 2012 21:53:34 +0000 (14:53 -0700)]
osd: only commit past intervals at end of parallel build
We don't check for gaps in the past intervals, so we should only commit
this when we are completely done. Otherwise a partial run and rsetart will
leave the gap in place, which may confuse the peering code that relies on
this information.
Sage Weil [Thu, 16 Aug 2012 00:19:22 +0000 (17:19 -0700)]
osd: explicitly requeue waiting_for_map in on_change()
Since we are requeuing stuff anyway, do it all in the correct order. This
fixes a bug where take_waiters() comes along later (at activate_map time)
and puts waiting_for_map events at the front of the queue, in front of
e.g. waiting_for_missing. This breaks ordering from the client's
perspective.
The convention should be: whenever you requeue, requeuing everything
that logically follows it first.
Fixes: #2947 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Sage Weil [Thu, 16 Aug 2012 19:53:18 +0000 (12:53 -0700)]
mds: fix some gcc 4.7 warnings
mds/Server.cc: In member function 'CDir* Server::validate_dentry_dir(MDRequest*, CInode*, const string&)':
mds/Server.cc:1607:12: warning: converting 'false' to pointer type 'CDir*' [-Wconversion-null]
mds/Server.cc:1620:12: warning: converting 'false' to pointer type 'CDir*' [-Wconversion-null]
mds/Server.cc: In member function 'CInode* Server::rdlock_path_pin_ref(MDRequest*, int, std::set<SimpleLock*>&, bool, bool, ceph_file_layout**)':
mds/Server.cc:1874:21: warning: converting 'false' to pointer type 'CInode*' [-Wconversion-null]
Sage Weil [Thu, 16 Aug 2012 18:38:46 +0000 (11:38 -0700)]
byteorder: fix gcc 4.7 warnings
./include/encoding.h: In function 'void encode(int64_t, ceph::bufferlist&, uint64_t)':
./include/encoding.h:101:1: warning: narrowing conversion of 'v' from 'int64_t {aka long int}' to '__le64 {aka long long unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
Danny Kukawka [Thu, 16 Aug 2012 10:56:58 +0000 (12:56 +0200)]
fix keyring generation for mds and osd
[ The following text is in the "UTF-8" character set. ]
[ Your display is set for the "ANSI_X3.4-1968" character set. ]
[ Some characters may be displayed incorrectly. ]
Fix config keys for OSD/MDS data dirs. As in documentation and other
places of the scripts the keys are 'osd data'/'mds data' and not
'osd_data'
In case if MDS: if 'mds data' doesn't exist, create it.
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Danny Kukawka [Thu, 16 Aug 2012 10:56:32 +0000 (12:56 +0200)]
fix ceph osd create help
[ The following text is in the "UTF-8" character set. ]
[ Your display is set for the "ANSI_X3.4-1968" character set. ]
[ Some characters may be displayed incorrectly. ]
Change ceph osd create <osd-id> to ceph osd create <uuid>, since this
is what the command is really doing.
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Sage Weil [Mon, 13 Aug 2012 17:46:30 +0000 (10:46 -0700)]
mon: require CRUSH_TUNABLES when latest osdmap has tunables set
This is an imperfect check in that tunables may be set in past osdmaps,
and the OSDs may need that in order to peer correctly. However, in the
general case, this will catch most users. In particular, it will catch
- set tunables
- nothing works (osds or clients lack feature)
- reset/clear tunables
- things recover
But not
- set tunables
- osds have feature, behave
- new osds with old code added, lack feature
- remove tunables
- new osds may fail to peer properly because they lack the feature
Sage Weil [Mon, 13 Aug 2012 17:43:39 +0000 (10:43 -0700)]
osd: put throttler on default policy
Before we were associating the throttler with a CLIENT specific policy
that didn't cover MDS. That's silly. Instead, associate the throttler
with the default policy (which is now possible).
Sage Weil [Mon, 13 Aug 2012 17:48:20 +0000 (10:48 -0700)]
msgr: make set_policy() and set_default_policy() safe to re-use
Introduce a policy_lock in SimpleMessenger to make this safe even after
the messenger has been started up. The user needs to be aware that
policy changes will not affect connections that are already established.
Sage Weil [Mon, 13 Aug 2012 20:15:55 +0000 (13:15 -0700)]
msg/Accepter: fix nonce initialization
This needs to be provided to the Accepter at bind time, not by start().
Otherwise the nonce is effectively always 0, which is useless and breaks
all sorts of things. Broken by 8453a8198c65712db968ff42be4fd10d2d216582.
Sage Weil [Sat, 11 Aug 2012 14:52:28 +0000 (07:52 -0700)]
msg/Accepter: use learned_addr() from Accepter::bind()
Normally we never go from need_addr == false to need_addr == true.
It always starts out as true, so this else is useless on the first
call to Accepter::bind().
The only exception is rebind(). Add an unlearn_addr() that will clear
need_addr. This is almost unnecessary, but doing so fixes a small bug
where the local_connection->peer_addr doesn't get updated when we do a
rebind().
Drop now-unused set_need_addr(). We keep get_need_addr() only because
it is useful in the debug output and for the assert.
Sage Weil [Tue, 31 Jul 2012 22:02:55 +0000 (15:02 -0700)]
cephtool: send keepalive to tell target
If we 'ceph tell <foo> ...' to a non-monitor, we need to send keepalives to
ensure we detect a tcp drop. (Not so for monitors; monclient already does
its own keepalive thing.)
Sage Weil [Tue, 31 Jul 2012 21:45:51 +0000 (14:45 -0700)]
cephtool: fix deadlock on fault when waiting for osdmap
send_command() was blocking for the osdmap, and also called from the
connect callback. Instead, re-call it from the handle_osd_map() callback
so that it never blocks.
This was easy to trigger with 'ceph osd tell osd.0 foo' and ms failure
injection.
Yehuda Sadeh [Mon, 18 Jun 2012 20:25:44 +0000 (13:25 -0700)]
rgw: use multiple notification objects
Issue #2504. This makes us listen and notify on more than
a single object, which reduces the contention of cache
notifications.
NOTE: This change requires that any radosgw and radosgw-admin
use the same 'rgw num control oids' config value. A config value
of 0 will maintain old compatibility, and will allow an upgraded
process run in conjuction with an old one. Setting value other
than 0 (or using the non-zero default) will require upgrading
and restarting all the gateways together. Failing to do so
might lead to inconsistent user and buckets metadata (which
will be resolved once gateways are restarted).
caleb miles [Thu, 9 Aug 2012 20:27:21 +0000 (13:27 -0700)]
rgw_admin.cc: Allow removal of a user's buckets during user removal.
Allow the buckets, and any child objects, of a user to be deleted when the
user is deleted through radosgw-admin. In reference to feature request
2499: http://tracker.newdream.net/issues/2499.
Signed-off-by: caleb miles <caleb.miles@inktank.com>
Josh Durgin [Fri, 3 Aug 2012 23:30:42 +0000 (16:30 -0700)]
librbd: add methods for protecting/unprotecting snapshots
Unprotect will be more useful once integrated with the rbd_children object.
Right now we just check that a snapshot is protected before cloning it,
and that it's unprotected before removing it.