Commit Graph

15903 Commits

Author SHA1 Message Date
Sage Weil
3f134257e2 Revert "mds: do not complain/assert about stray inode rstat/fragstat consistency"
This reverts commit d3d767a2a3.

A better solution is to keep the stray frags loaded+pinned.
2011-08-22 13:19:04 -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
Samuel Just
93c0565e59 PG: Move reset_last_warm_restart to Initial::exit
Previously, reset_last_warm_restart was only invoked when handle_create
was used.  This misses cases where the pg is initialized via a Notify,
Log, or Info message.  reset_last_warm_restart will now be called from
the Initial state exit handler in order to handle the other cases.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-08-22 13:11:15 -07:00
Sage Weil
239f61e781 .gitignore: scratchtool
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-21 16:46:23 -07:00
Sage Weil
c61568512e testlibrbd: add missing va_end()
Coverity cid 57, 58

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-21 09:05:54 -07:00
Yehuda Sadeh
29c1ce5585 rgw: remove redundant line 2011-08-20 23:32:43 -07:00
Sage Weil
d3d767a2a3 mds: do not complain/assert about stray inode rstat/fragstat consistency
We instantiate the stray dirfrags without reading the fragstat off of disk
because it's faster, we know the dentry is unique, and we don't care about
the stats.  It can lead to inconsistency between the dirfrag frag/rstat
and the inodes, though.  Silently clean it up when we hit it; that's
simpler than not maintaining it at all for those directories.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-20 20:42:30 -07:00
Sage Weil
f6c07efdac paxos: fix store_state
Stop if we empty out the map completely.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-20 15:04:55 -07:00
Sage Weil
0935673442 monclient: be less chatty about stray messages
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-20 09:56:49 -07:00
Sage Weil
64ce3030d4 debian: librbd headers require librados headers
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-20 07:32:19 -07:00
Yehuda Sadeh
c75f0fca04 scratchtool: not a test suite 2011-08-19 23:40:40 -07:00
Yehuda Sadeh
ab40c3c0b6 Revert "Remove old rados tests"
This reverts commit 665fd8214d.

Conflicts:

	src/testradospp.cc
2011-08-19 23:36:51 -07:00
Yehuda Sadeh
331d0aa735 osd: fix compilation 2011-08-19 23:32:36 -07:00
Sage Weil
6fca62499d osd: call incorrect osdmap addrs errors
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-19 20:37:33 -07:00
Yehuda Sadeh
3794bd9c4c rgw: fail operation when trying to clone to the same shadow
not necessary to recreate the same shadow, and also provides mutual
exclusion
2011-08-19 17:35:26 -07:00
Sage Weil
e5cf2a4f4c mds: xlocker_caps are supplemental to caps
Like loner_caps, xlocker_caps are additional caps to the any caps.

In practical terms, this only affects (currently) the LOCK_XLOCKDONE state
for the filelock, where it's less work than making sure what is in the any
column is also |'d onto the xlocker column.  Easier to read :)

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 16:16:35 -07:00
Sage Weil
a35ac29bef mds: only client hold xlock in xlockdone can change lock state
If we are in xlockdone, only the client holding that xlock can adjus the
lock state (e.g., relock).  Other clients have to wait until the xlock
cycle unwinds completely.

Fixes: #1417
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 16:16:35 -07:00
Yehuda Sadeh
1dfdc730f7 rgw: fix prepare_atomic_for_write 2011-08-19 16:21:15 -07:00
Sage Weil
ac248f1a00 mds: update truncate_pending on O_TRUNC; pass old_size on O_TRUNC open
We were missing truncate_pending++ in O_TRUNC path.  Use a common helper.

Pass old_size on O_TRUNC open.  (This was the real bug we worked around in
79db9fc509933429f4a8f4aca6d3da5517c43d1f.)

Only do an actual truncate if old_size > 0.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-19 13:53:06 -07:00
Sage Weil
2d0bd2df55 rados-api: fix #include order
Fixes conflict with linux types on fatty.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 13:07:42 -07:00
Sage Weil
513f6128a1 cconf: fix clitest
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 13:05:42 -07:00
Sage Weil
72044499b8 cconf: --filter-key and --filter-key-value
Filter out section list to sections that define a given key or that
set a key to a given value.

This is useful to, for example, filter out sections mapped to the current
host.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 12:54:56 -07:00
Sage Weil
f5b012c861 mds: fix LOCK_LOCK_XLOCK lock state name/string
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 12:54:56 -07:00
Yehuda Sadeh
f3396bdc50 rgw: add missing cache locking
this was overlooked when switch to the multithreaded configuration
2011-08-19 12:56:38 -07:00
Yehuda Sadeh
0b216bdc8c rgw: was missing return value 2011-08-19 12:33:08 -07:00
Yehuda Sadeh
32db9dc5bf rgw: some more race fixes 2011-08-19 12:27:43 -07:00
Colin Patrick McCabe
e759021b9b test/rados-api/misc.cc: update tests after API change
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-19 09:51:30 -07:00
Sage Weil
f0ab8b06f1 monitorstore: drop unused sync value
This is inherently unsafe, because we write to a final filename without
ensuring the data is on disk.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 09:53:57 -07:00
Sage Weil
dfab2c91f5 paxos: use MonitorStore::put_bl_sn_map() to commit batches of values
This allows us to (safely) do fsync vs sync optimizations.  The old code
would write values to the final names and then sync(2), but a crash in
between could leave 0-length (non-temporary) files and crash.

Fixes: #1414
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 09:53:57 -07:00
Sage Weil
bec7390489 monitorstore: implement put_bl_sn_map
This will commit a big batch of values safely.  We push it down into
MonitorStore so we can avoid an fsync(2) per file.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 09:53:57 -07:00
Sage Weil
ed580c558c mon: whitespace
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-19 09:53:57 -07:00
Greg Farnum
635bbe839f atomic_t: update spinlock implementation.
Somebody added a 'set' function without adding the non-atomic_ops
version!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-08-19 09:15:50 -07:00
Yehuda Sadeh
fb7831c301 rgw: reread obj meta on racing write operation 2011-08-18 23:36:50 -07:00
Samuel Just
8db7daf68d ReplicatedPG: Don't crash when a clone is missing
Print an error rather than crashing when _scrub finds a missing
clone.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-08-18 18:15:53 -07:00
Greg Farnum
9f5d16384a file_layout.sh: add test for setting a new data pool
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-08-18 17:36:22 -07:00
Colin Patrick McCabe
8c822a80e5 Merge branch 'wip-librados-tests'
Conflicts:
	src/include/rados/librados.hpp
	src/librados.cc
	src/rgw/rgw_rados.cc
	src/testradospp.cc
2011-08-18 17:00:38 -07:00
Colin Patrick McCabe
665fd8214d Remove old rados tests
These tests have been supplanted by the rados-api gtests.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 16:34:48 -07:00
Yehuda Sadeh
eb8925a730 rgw: fix locator for shadow objects 2011-08-18 16:33:18 -07:00
Sage Weil
1546beaf3c mds: share max_size on any client_range adjustment
We were missing this on open + O_CREAT (now triggered by cfuse), on open +
O_TRUNC, and on mknod.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-18 15:15:38 -07:00
Colin Patrick McCabe
b8b8f9dcf7 add WatchNotifyTimeoutTestPP
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 15:06:54 -07:00
Yehuda Sadeh
0c0071a441 rgw: fix a double free in GetObj 2011-08-18 15:06:32 -07:00
Colin Patrick McCabe
d454c58433 test/rados-api/misc.cc: test CloneRange
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 12:55:12 -07:00
Colin Patrick McCabe
17ee7f8fcd test/rados-api/misc.cc: test CloneRangePP
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 12:52:57 -07:00
Colin Patrick McCabe
9c8722a6d8 test/rados-api/misc.cc: test AioOperatePP
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 12:32:08 -07:00
Sage Weil
8ce6544764 osd: fix _activate_committed() crash
Do not dereference acting[0] unless we know it is still valid.

Take a reference when scheduling the transaction, and drop it in the
completion, to ensure that the PG isn't removed out from underneath us.

Fixes: #1379
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-18 11:16:51 -07:00
Colin Patrick McCabe
0ae230b1ff test/rados-api/misc.cc: test Operate2PP
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 11:15:37 -07:00
Colin Patrick McCabe
2903de0a59 Operate1PP: test CEPH_OSD_CMPXATTR_OP_EQ
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 11:11:36 -07:00
Sage Weil
6d90796fc9 compatset: dump json
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-18 10:07:12 -07:00
Colin Patrick McCabe
f5f2cd1c2d librados: remove unused operate param
The last parameter of operate, aio_operate was unused and unchecked.
Remove it.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-18 10:03:02 -07:00
Sage Weil
d21c918b73 uninline a bunch of buffer.h stuff 2011-08-18 08:44:28 -07:00