Commit Graph

29547 Commits

Author SHA1 Message Date
Adam Twardowski
0388b712b4 Update init-rbdmap
Add a chkconfig line for RHEL based distros to make chkconfig start rbdmap earlier on boot and stop later on shutdown.  This will help prevent shutdown/reboot from hanging your system forever in the event that some daemon has a file held open on an rbd mounted filesystem.

Signed-off-by: Adam Twardowski <adam.twardowski@gmail.com>(cherry picked from commit 80384a1a24)
2013-10-24 14:49:53 -07:00
Greg Farnum
0d326c3fa5 ceph: tolerate commands without any child args
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 12:35:47 -07:00
Josh Durgin
9fa9ed122e Merge branch 'wip-rgw-sync-next' into next
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2013-10-24 11:45:06 -07:00
Josh Durgin
cfe845115b rgw: eliminate one unnecessary case statement
0x21 '!' is the first character that doesn't need encoding, so we can
expand the lower bound check.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 11:37:07 -07:00
Josh Durgin
f9a6d71904 radosgw-admin: remove unused function escape_str()
This was added before formatters were used for dumping logs.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:59:07 -07:00
Josh Durgin
ec45b3b88c rgw: escape bucket and object names in StreamReadRequests
This fixes copy operations for objects that contain unsafe characters,
like a newline, which would return a 403 otherwise, since the GET to
the source rgw would be unable to verify the signature on a partially
valid bucket name.

Fixes: #6604
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:58:59 -07:00
Josh Durgin
dd308cd481 rgw: move url escaping to a common place
This is useful outside of the s3 interface. Rename url_escape()
url_encode() for consistency with the exsting common url_decode()
function. This is in preparation for the next commit, which needs
to escape url-unsafe characters in another place.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:58:48 -07:00
Josh Durgin
e0e8fb1b2b rgw: update metadata log list to match data log list
Send the last marker whether the log is truncated in the same format
as data log list, so clients don't have more needless complexity
handling the difference.  Keep bucket index logs the same, since they
contain the marker already, and are not used in exactly the same way
metadata and data logs are.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:56:48 -07:00
Josh Durgin
c275912509 rgw: include marker and truncated flag in data log list api
Consumers of this api need to know their position in the log. It's
readily available when fetching the log, so return it.  Without the
marker in this call, a client could not easily or efficiently figure
out its position in the log, since it would require getting the global
last marker in the log, and then reading all the log entries.

This would be slow for large logs, and would be subject to races that
would cause potentially very expensive duplicate work.

Returning this atomically while fetching the log entries simplifies
all of this.

Fixes: #6615
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:56:45 -07:00
Josh Durgin
e74776f417 cls_log: always return final marker from log_list
There's no reason to restrict returning the marker to the case where
less than the whole log is returned, since there's already a truncated
flag to tell the client what happened.

Giving the client the last marker makes it easy to consume when the
log entries do not contain their own marker. If the last marker is not
returned, the client cannot get the last marker without racing with
updates to the log.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:56:07 -07:00
Josh Durgin
ea816c1c2f rgw: skip read_policy checks for system_users
A system user should still be able to examine suspended buckets, and
get -ENOENT instead of -EACCESS for a deleted object.

Fixes: #6616
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-24 08:56:02 -07:00
Sage Weil
71d1a28806 Merge pull request #761 from ceph/wip-6620
mds: MDSMap: adjust buffer size for uint64 values with more than 5 chars

Backport: dumpling, cuttlefish
2013-10-23 16:24:23 -07:00
Joao Eduardo Luis
0e8182edd8 mds: MDSMap: adjust buffer size for uint64 values with more than 5 chars
Fixes: #6620

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-24 00:17:45 +01:00
João Eduardo Luís
c2cf8489bc Merge pull request #730 from ceph/wip-monc-ping
mon: MonClient: ping monitors without authenticating

* add support on the monitor to reply to MPing messages with the contents of
  'mon_status' and 'health', regardless of a client having authenticated beforehand.

* add support on the MonClient to send a MPing message to a randomly picked
  monitor (it was easier this way, '-m ip:port' allows for targeted ping) and block
  waiting for a reply.

* add support on librados, pybind/rados.py and the 'ceph' tool to send pings to
  monitors.

Resolves: #5984

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-10-22 19:18:55 -07:00
Joao Eduardo Luis
7ba4bc4ab7 cli: ceph: add support to ping monitors
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 03:04:23 +01:00
Joao Eduardo Luis
400cb18bbc pybind: rados: ping a monitor via librados
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:54:40 +01:00
Joao Eduardo Luis
1a2e0ebaf1 pybind: rados: support ETIMEDOUT on make_ex()
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:54:34 +01:00
Joao Eduardo Luis
2d7ccab382 librados: support pinging a monitor without auth via RadosClient
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:52:01 +01:00
Joao Eduardo Luis
6a4b196a5b mon: MonClient: allow pinging a monitor without authenticating first
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:52:01 +01:00
Joao Eduardo Luis
c521ba78b1 mon: MonClient: adjust whitespaces
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:52:01 +01:00
Joao Eduardo Luis
5e4652eb8c mon: Monitor: reply to ping messages, letting them know we're alive
Fixes: #5984

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:52:01 +01:00
Joao Eduardo Luis
4ca1407fd9 mon: Monitor: do not flush formatter at end of _mon_status()
Delegate that to the caller so that we can combine the result of
_mon_status() with the result of other functions.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-10-23 02:52:01 +01:00
Sage Weil
dbbf9938e3 Merge remote-tracking branch 'gh/wip-6242-b' into next
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
2013-10-22 13:32:01 -07:00
Sage Weil
1821ad781b pybind/rados: create InterruptedOrTimeoutError exception
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 13:12:59 -07:00
Sage Weil
12308862f7 ceph: move timeout
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 13:02:22 -07:00
Sage Weil
8baeac0df9 ceph: catch exceptions thrown during the rados handle init
In my case, making ceph.conf unreadable triggers an exception here:

Traceback (most recent call last):
  File "./ceph", line 802, in <module>
    sys.exit(main())
  File "./ceph", line 575, in main
    conf_defaults=conf_defaults, conffile=conffile)
  File "/home/sage/src/ceph/src/pybind/rados.py", line 221, in __init__
    self.conf_read_file(conffile)
  File "/home/sage/src/ceph/src/pybind/rados.py", line 272, in conf_read_file
    raise make_ex(ret, "error calling conf_read_file")
rados.Error: error calling conf_read_file: errno EACCES

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 12:54:09 -07:00
Sage Weil
d60e532e28 ceph: show basic help before initializing cluster connection
That way we still get help if there is an error.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 12:53:30 -07:00
Sage Weil
b33c3158d4 ceph: default 5 second timeout for -h
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 12:35:06 -07:00
Sage Weil
15de2c48a1 ceph: add --connect-timeout option
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 12:34:53 -07:00
Sage Weil
e9224755e2 ceph: print basic options before connecting
This will let you control-c if the mon is unresponsive.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 12:34:41 -07:00
Greg Farnum
445e8c9860 ceph: fixup do_help() function connection check
We might have cluster_handle defined, but not have
successfully connected. Instead, check if it's in
the connected state.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-10-22 12:33:03 -07:00
Sage Weil
32a23c5bba ceph.in: add emacs modeline
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 12:33:03 -07:00
Yehuda Sadeh
5cf31bf9e7 Merge branch 'wip-6606' into next
Reviewed-by: Sage Weil <sage@inktank.com>
2013-10-22 12:27:51 -07:00
Yehuda Sadeh
771b0c58d5 rgw: don't bother to call c_str() on strings passed to dump_string()
dump_string() also accepts const string reference.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-10-22 12:10:57 -07:00
Josh Durgin
3445810f1f Merge pull request #754 from ceph/wip-test-librbd
fix ceph_test_lirbd crash
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-22 10:04:25 -07:00
Sage Weil
dff41cd768 ceph_test_librbd: fix heap overrun
We are storing rbd_snap_info_t structs, not pointers to them.  But we
can also avoid the heap entirely.

This crashed pretty reliably on arm.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-22 09:37:08 -07:00
Yehuda Sadeh
ccaab2abf9 rgw: init src_bucket_name, src_object in the S3 handler
Be consistent and initialize these fields also in the S3 case.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-10-21 18:02:32 -07:00
Yehuda Sadeh
db7eb77122 rgw: get rid of req_state.bucket_name
No need for this field, as we already have req_state.bucket_name_str.
This saves us some memory allocation / freeing through every request
processing.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-10-21 16:25:24 -07:00
Yehuda Sadeh
cbf8f9a517 rgw: turn swift COPY into PUT
Fixes: #6606
The swift COPY operation is unique in a sense that it's a write
operation that has its destination not set by the URI target, but by a
different HTTP header. This is problematic as there are some hidden
assumptions in the code that the specified bucket/object in the URI is
the operation target. E.g., certain initialization functions, quota,
etc. Instead of creating a specialized code everywhere for this case
just turn it into a regular copy operation, that is, a PUT with
a specified copy source.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-10-21 16:25:19 -07:00
Sage Weil
1f6b8b27b0 librbd: parse args to ceph_test_librbd
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-21 15:55:32 -07:00
Sage Weil
ad4553a4fd librbd: fix build error
From a10703008f.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-21 15:48:42 -07:00
Sage Weil
bd2eeb71bc ceph-mon: add debug to ip selection
This will hopefully help us track down #5804.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-21 15:33:37 -07:00
Josh Durgin
ad455c8ebe Merge pull request #753 from ceph/wip-5668-b
librbd: wire up flush counter
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-10-21 14:58:31 -07:00
Sage Weil
a10703008f librbd: wire up flush counter
Fixes: #5668
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-21 14:40:03 -07:00
Loic Dachary
1376d2379a Merge pull request #751 from ceph/wip-6603
a couple trivial leaks
2013-10-21 11:20:37 -07:00
Sage Weil
715d2ab318 common/BackTrace: fix memory leak
Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-21 09:22:35 -07:00
Sage Weil
687ecd8bf9 common/cmdparse: fix memory leak
demangle is allocating with malloc() in this case.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-10-21 09:21:57 -07:00
Sage Weil
ddfe67fe2a Merge pull request #746 from ceph/wip-6582
Wip 6582

Reviewed-by: Sage Weil <sage@inktank.com>
2013-10-18 23:08:08 -07:00
Greg Farnum
8586c755ff ReplicatedPG: copy: conditionally requeue copy ops when cancelled
We may need to requeue copy ops which are cancelled as part of an acting
set change but don't change the primary. To support this, add a
"requeue" flag to cancel_copy_ops() and copy_ops(), as well as to
CopyResults. The CopyCallback is then responsible for requeuing (the
higher layers can't do so as they can't know which request actually
triggered the copy).

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-10-18 16:34:11 -07:00
Greg Farnum
6dff926151 PG: add a requeue_op() function to complement requeue_ops().
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-10-18 16:24:27 -07:00