summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-26 18:24:40 -0700
committerSage Weil <sage@inktank.com>2013-09-26 18:24:40 -0700
commit493427ddd6b443a511182565a574253c1d864c6f (patch)
treec8bcdc4c79acb0e466b6909603586fd159aba304
parent97c56ef3ec3f3641cc6ee536842e21c1a70d1dfe (diff)
parent5e3145a4d3ee50be6cb6542d2be192eb60fd6f8e (diff)
downloadceph-493427ddd6b443a511182565a574253c1d864c6f.tar.gz
Merge remote-tracking branch 'gh/next'
Conflicts: src/pybind/ceph_argparse.py
-rw-r--r--qa/run_xfstests.sh3
-rwxr-xr-xqa/workunits/cephtool/test.sh11
-rwxr-xr-xsrc/ceph.in4
-rw-r--r--src/mon/MonCommands.h2
-rw-r--r--src/mon/OSDMonitor.cc8
-rw-r--r--src/osd/ReplicatedPG.cc3
-rw-r--r--src/pybind/ceph_argparse.py21
7 files changed, 42 insertions, 10 deletions
diff --git a/qa/run_xfstests.sh b/qa/run_xfstests.sh
index f3dffca293f..f9c3e55a79d 100644
--- a/qa/run_xfstests.sh
+++ b/qa/run_xfstests.sh
@@ -276,6 +276,9 @@ function install_xfstests() {
cd xfstests
+ # FIXME: use an older version before the tests were rearranged!
+ git reset --hard e5f1a13792f20cfac097fef98007610b422f2cac
+
ncpu=$(getconf _NPROCESSORS_ONLN 2>&1)
[ -n "${ncpu}" -a "${ncpu}" -gt 1 ] && multiple="-j ${ncpu}"
diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh
index 51420a2f134..09e55b9a842 100755
--- a/qa/workunits/cephtool/test.sh
+++ b/qa/workunits/cephtool/test.sh
@@ -169,7 +169,16 @@ bl=192.168.0.1:0/1000
ceph osd blacklist add $bl
ceph osd blacklist ls | grep $bl
ceph osd blacklist rm $bl
-expect_false "(ceph osd blacklist ls | grep $bl)"
+expect_false "ceph osd blacklist ls | grep $bl"
+
+bl=192.168.0.1
+# test without nonce, invalid nonce
+ceph osd blacklist add $bl
+ceph osd blacklist ls | grep $bl
+ceph osd blacklist rm $bl
+expect_false "ceph osd blacklist ls | grep $bl"
+expect_false "ceph osd blacklist $bl/-1"
+expect_false "ceph osd blacklist $bl/foo"
ceph osd crush tunables legacy
ceph osd crush tunables bobtail
diff --git a/src/ceph.in b/src/ceph.in
index 320e4bd413f..e4d4cf10344 100755
--- a/src/ceph.in
+++ b/src/ceph.in
@@ -476,6 +476,9 @@ def complete(sigdict, args, target):
###
def main():
+ ceph_args = os.environ.get('CEPH_ARGS')
+ if ceph_args:
+ sys.argv.extend(ceph_args.split())
parser, parsed_args, childargs = parse_cmdargs()
@@ -556,7 +559,6 @@ def main():
cluster_handle = rados.Rados(name=name, clustername=clustername,
conf_defaults=conf_defaults, conffile=conffile)
- cluster_handle.conf_parse_env()
retargs = cluster_handle.conf_parse_argv(childargs)
#tmp = childargs
childargs = retargs
diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h
index 752745a0c22..33e00a98d30 100644
--- a/src/mon/MonCommands.h
+++ b/src/mon/MonCommands.h
@@ -59,7 +59,7 @@
* CephString: optional badchars
* CephSocketpath: validation involves "is it S_ISSOCK"
* CephIPAddr: v4 or v6 addr with optional port, syntax validated
- * CephEntityAddr: CephIPAddr + '/nonce'
+ * CephEntityAddr: CephIPAddr + optional '/nonce'
* CephPoolname: Plainold string
* CephObjectname: Another plainold string
* CephPgid: n.xxx where n is an int > 0, xxx is a hex number > 0
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index f4fe49bf8de..9144736d801 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -120,7 +120,12 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
* We will possibly have a stashed latest that *we* wrote, and we will
* always be sure to have the oldest full map in the first..last range
* due to encode_trim_extra(), which includes the oldest full map in the trim
- * transaction. Start with whichever is newer.
+ * transaction.
+ *
+ * encode_trim_extra() does not however write the full map's
+ * version to 'full_latest'. This is only done when we are building the
+ * full maps from the incremental versions. But don't panic! We make sure
+ * that the following conditions find whichever full map version is newer.
*/
version_t latest_full = get_version_latest_full();
if (latest_full == 0 && get_first_committed() > 1)
@@ -637,7 +642,6 @@ void OSDMonitor::encode_trim_extra(MonitorDBStore::Transaction *tx, version_t fi
bufferlist bl;
get_version_full(first, bl);
put_version_full(tx, first, bl);
- put_version_latest_full(tx, first);
}
// -------------
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 7831f95818d..c826c38c145 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -2930,6 +2930,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
op.extent.length = (op.extent.offset > oi.size ? 0 : oi.size - op.extent.offset);
dout(10) << " old truncate_seq " << op.extent.truncate_seq << " < current " << seq
<< ", adjusting write length to " << op.extent.length << dendl;
+ bufferlist t;
+ t.substr_of(osd_op.indata, 0, op.extent.length);
+ osd_op.indata.swap(t);
}
if (op.extent.truncate_seq > seq) {
// write arrives before trimtrunc
diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py
index f115d3791af..7ec7b8b2f0c 100644
--- a/src/pybind/ceph_argparse.py
+++ b/src/pybind/ceph_argparse.py
@@ -275,15 +275,26 @@ class CephIPAddr(CephArgtype):
class CephEntityAddr(CephIPAddr):
"""
- EntityAddress, that is, IP address/nonce
+ EntityAddress, that is, IP address[/nonce]
"""
def valid(self, s, partial=False):
- try:
+ nonce = None
+ if '/' in s:
ip, nonce = s.split('/')
- except:
- raise ArgumentValid('{0} must contain a /'.format(s))
+ else:
+ ip = s
super(self.__class__, self).valid(ip)
- self.nonce = nonce
+ if nonce:
+ nonce_long = None
+ try:
+ nonce_long = long(nonce)
+ except ValueError:
+ pass
+ if nonce_long is None or nonce_long < 0:
+ raise ArgumentValid(
+ '{0}: invalid entity, nonce {1} not integer > 0'.\
+ format(s, nonce)
+ )
self.val = s
def __str__(self):