Commit Graph

872 Commits

Author SHA1 Message Date
Colin Patrick McCabe
693c4e50e5 Merge branch 'wip-argparse'
Conflicts:
	src/rgw/rgw_admin.cc
2011-09-06 15:39:30 -07:00
Colin Patrick McCabe
21dbec9cec ceph_argparse: remove unused macros, functions
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-06 15:28:45 -07:00
Colin Patrick McCabe
316dd910b1 Add ceph_argparse_withlonglong
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-06 15:28:45 -07:00
Colin Patrick McCabe
1ccbfeabdf ceph_argparse: add ceph_argparse_withint
Add an easy way of parsing an int argument. Always match va_start with
va_end.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-06 15:28:44 -07:00
Yehuda Sadeh
6506d43cbc rgw: log of nonexsistent bucket config option 2011-09-02 12:18:43 -07:00
Yehuda Sadeh
d0eed62418 rgw: poll allocation thread 2011-09-01 16:00:39 -07:00
Yehuda Sadeh
4fa62d5e02 rgw: configurable thread pool size 2011-09-01 11:39:59 -07:00
Sage Weil
cf862c65fd assert: use our assert
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-31 10:00:51 -07:00
Sage Weil
5ae3e13617 crypto: reinclude our assert to clobber system one
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-31 10:00:51 -07:00
Samuel Just
341fb208aa FileStore: Add filestore version stamp
A filestore will now be tagged with a version stamp during
mkfs.  If on mount the version stamp detected lags the current
version, the mount will fail unless filestore_update_collections
is set in gconf.  If it is set, opening a collection will cause
the version stamp on the collection to be read and the
appropriate indexing implmentation to be used.  This will allow
for conversion from old collection indexing schemes to new
ones.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-08-29 17:43:06 -07:00
Samuel Just
d0744cdd1a FileStore: CollectionIndex, HashIndex, IndexManager
Adds ColletionIndex, an interface for collection indexing
systems, and HashIndex, a mechanism for organising a prehashed
collection.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-08-29 17:43:05 -07:00
Yehuda Sadeh
f2d19a0317 json escaping fix 2011-08-29 17:12:03 -07:00
Yehuda Sadeh
19f09c0a83 fix json escaping 2011-08-29 17:02:38 -07:00
Sage Weil
853658e9f1 heartbeatmap: fix reset_timeout with mixed-used threads
If you have a ThreadPool used by multiple WorkQueues, and some of them are
setting a suicide timeout, we need to clear it when a suicide timeout is
not set.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-29 15:02:46 -07:00
Sage Weil
502cf0b239 filestore: add suicide grace to workqueue
The main thing we are worried about here are kernel BUGs that kill off our
threads.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-29 11:46:16 -07:00
Sage Weil
5fde4011ac heartbeatmap: add suicide grace
Add a second suicide grace period that will make us kill ourselves if
we are sufficiently catatonic.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-29 11:46:15 -07:00
Sage Weil
0b00350bc8 ceph_context: whitespace
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-27 09:25:26 -07:00
Sage Weil
09b08c5d34 fix utime.h #include recursion
Coverity cid 11, 13

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-26 09:11:16 -07:00
Sage Weil
23d94a4c5a Revert "pipe.c: #define GNU_SOURCE"
This reverts commit ae9ba2249e.

This is handled in master by the Makefile.
2011-08-24 09:38:09 -07:00
Sage Weil
c2e4047a88 Merge branch 'next' 2011-08-24 09:38:01 -07:00
Colin Patrick McCabe
b76e054bc0 WorkQueue: don't be chatty about finishing workers
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:26 -07:00
Colin Patrick McCabe
31bf064b6e Some fixes to double-dash support, fix warning
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:06 -07:00
Colin Patrick McCabe
eecf4d6175 ceph_argparse: handle double dashes consistently
Handle double dashes in the ceph_argparse functions, so that any piece
of code doing argument parsing will correctly interpret them.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 16:30:03 -07:00
Colin Patrick McCabe
18ec5655fe injectargs: binary flags only consume 1 token
Never consume more than one token when parsing a binary flag.

Basically, your choices are --foo=false, --foo=true, and just --foo.
However, only 1 token will ever be examined.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 15:46:07 -07:00
Colin Patrick McCabe
42a65b8d69 config: print warning on injectargs parse fail
injectargs should print a warning message when its parser fails.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 15:46:07 -07:00
Colin Patrick McCabe
3432729397 common/config: fix get_val for booleans
md_config_t::get_val should return true/false for booleans, not 0/1.
This is for consistency with the setter.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 14:26:49 -07:00
Colin Patrick McCabe
ae9ba2249e pipe.c: #define GNU_SOURCE
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 14:12:15 -07:00
Colin Patrick McCabe
29cf7333a7 common/config: honor --
Argument parsing should stop after --

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 11:56:13 -07:00
Sage Weil
deb25e00f2 mon: make auto-marking of booting osds 'in' optional
By default we mark a booting OSD 'in' so that it immediately gets data.
Make this optional.

Eventually we may want to make this default to off...

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 11:21:44 -07:00
Colin Patrick McCabe
3ce41446a6 Define _GNU_SOURCE in src/Makefile.am
We end up needing _GNU_SOURCE in a bunch of places-- to get direct i/o,
pipe2, and some other Linux-specific interfaces.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-22 15:35:13 -07:00
Colin Patrick McCabe
4e9a0b6d30 pipe.c: #define GNU_SOURCE
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-22 15:06:16 -07:00
Colin Patrick McCabe
b00b6f685a common/pipe: add function to do pipe2(O_CLOEXEC)
Support old systems that don't have O_CLOEXEC.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-22 13:11:18 -07:00
Colin Patrick McCabe
abe5cd28d1 common/pipe: add function to do pipe2(O_CLOEXEC)
Support old systems that don't have O_CLOEXEC.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-22 11:13:55 -07:00
Sage Weil
7d2f4a5112 escape: fix snprintf args
Include space for null termination.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-21 16:26:54 -07:00
Sage Weil
b5a2ad0e86 escape: use snprintf
Coverity cid 41, 40

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-21 14:10:41 -07:00
Sage Weil
41745a9166 secret: use strncpy, snprintf
Coverity cid 42

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-21 14:07:21 -07:00
Sage Weil
8b0d065145 formatter: less big buffer for dump format string
Coverity cid 53

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-21 13:51:55 -07:00
Sage Weil
d21c918b73 uninline a bunch of buffer.h stuff 2011-08-18 08:44:28 -07:00
Sage Weil
df99cd9b11 mds: add debug_mds_locker
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-17 18:38:20 -07:00
Sage Weil
2df3f2c946 cfuse: make use of fuse invalidate callback optional (and off by default)
This is hitting a deadlock in fuse itself (or so it appears).  Disable it
until that's sorted out.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-17 12:25:56 -07:00
Yehuda Sadeh
1179a31b74 formatter: remove bad asserts 2011-08-17 12:16:37 -07:00
Colin Patrick McCabe
8072bdcaa4 Fix bug in turning off logging. Remove log_dir.
Fix a bug that made it impossible to turn off logging to a file.

Remove the old "log_dir" setting. It has been deprecated for a long
time, and it adds a lot of complexity to the code.

heap_profiler: use the directory that log_file is in to construct a
profiler output file name. Don't use log_dir.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-15 20:58:23 -07:00
Colin Patrick McCabe
ad31db9e2f Remove unused dyn_sprintf
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-05 15:49:30 -07:00
Colin Patrick McCabe
6ad7f46bda config.cc: clean up includes
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-05 15:44:32 -07:00
Colin Patrick McCabe
9f608c726c config: more thread-safety stuff
* Don't allow parse_argv, parse_env, or parse_config_files to be used
after threads have been started.

* Don't allow set_val to be used to change unsafe variables after
threads have been started.

* Test

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-05 12:49:37 -07:00
Colin Patrick McCabe
d99333d043 injectargs: forbid unsafe string modifications
Don't allow string-valued configuration items to be changed using
injectargs unless they have observers. Otherwise, we could have
crashes, since one thread could be reading the std::string's internal
buffer after another thread frees that buffer during assignment.

Write a unit test to validate this behavior.

Also test that we can turn on and off the log_file using injectargs.
This is something that injectargs often gets used for in practice.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-05 12:18:00 -07:00
Colin Patrick McCabe
92e976a503 config: more cleanup
* any place where we know a set_val can't fail should be set_val_or_die

* in private md_config_t functions that need the mutex, assert that the
mutex is locked

* make md_config_t::expand_meta private, since nobody uses it outside of
the class.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-05 10:32:42 -07:00
Colin Patrick McCabe
2c9949e0ca config: add proper locking, fix comments
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-04 16:49:55 -07:00
Colin Patrick McCabe
7ec6909b13 Merge branch 'rgw-formatter' 2011-08-04 15:33:27 -07:00
Colin Patrick McCabe
0413e2acd6 Formatter: add open_object_section_in_ns, etc.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-04 14:27:14 -07:00