summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/rados/operations/authentication.rst14
-rwxr-xr-xqa/workunits/mon/crush_ops.sh9
-rw-r--r--src/arch/intel.c7
-rw-r--r--src/common/config_opts.h2
-rw-r--r--src/common/crc32c_intel_fast.h2
-rw-r--r--src/mon/OSDMonitor.cc31
-rw-r--r--src/osd/ReplicatedPG.cc5
-rw-r--r--src/test/Makefile.am3
-rw-r--r--src/test/librados/misc.cc24
9 files changed, 62 insertions, 35 deletions
diff --git a/doc/rados/operations/authentication.rst b/doc/rados/operations/authentication.rst
index 0b71d08b0c4..6bacf4c7dff 100644
--- a/doc/rados/operations/authentication.rst
+++ b/doc/rados/operations/authentication.rst
@@ -126,18 +126,15 @@ you may skip the steps related to generating keys.
auth service required = cephx
auth client required = cephx
-#. Or, enable ``cephx`` authentication for versions ``0.50`` and below by
+#. Or, enable ``cephx`` authentication for Ceph versions ``0.50`` and below by
setting the following option in the ``[global]`` section of your `Ceph
- configuration`_ file::
+ configuration`_ file. **NOTE:** Deprecated as of version ``0.50``. ::
auth supported = cephx
-.. deprecated:: 0.51
-#. Start or restart the Ceph cluster. ::
+#. Start or restart the Ceph cluster. See `Operating a Cluster`_ for details.
- sudo service ceph -a start
- sudo service ceph -a restart
.. _disable-cephx:
@@ -164,10 +161,8 @@ during setup and/or troubleshooting to temporarily disable authentication.
auth supported = none
-#. Start or restart the Ceph cluster. ::
+#. Start or restart the Ceph cluster. See `Operating a Cluster`_ for details.
- sudo service ceph -a start
- sudo service ceph -a restart
Daemon Keyrings
@@ -422,3 +417,4 @@ of the enhanced authentication.
.. _Ceph configuration: ../../configuration/ceph-conf
.. _Cephx Configuration Reference: ../../configuration/auth-config-ref
+.. _Operating a Cluster: ../operating \ No newline at end of file
diff --git a/qa/workunits/mon/crush_ops.sh b/qa/workunits/mon/crush_ops.sh
index 09e49acfbf6..c2744fa279d 100755
--- a/qa/workunits/mon/crush_ops.sh
+++ b/qa/workunits/mon/crush_ops.sh
@@ -68,4 +68,13 @@ ceph osd crush add-bucket foo host
ceph osd crush move foo root=default rack=localrack
ceph osd crush rm foo
+# test reweight
+o3=`ceph osd create`
+ceph osd crush add $o3 123 root=foo
+ceph osd tree | grep osd.$o3 | grep 123
+ceph osd crush reweight osd.$o3 113
+ceph osd tree | grep osd.$o3 | grep 113
+ceph osd crush rm osd.$o3
+ceph osd rm osd.$o3
+
echo OK
diff --git a/src/arch/intel.c b/src/arch/intel.c
index 0513da53c23..8b2d2ccab12 100644
--- a/src/arch/intel.c
+++ b/src/arch/intel.c
@@ -4,8 +4,7 @@
int ceph_arch_intel_sse42 = 0;
-/* this probably isn't specific enough for x86_64? fix me someday */
-#ifdef __LP64__
+#ifdef __x86_64__
/* intel cpu? */
static void do_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
@@ -35,7 +34,7 @@ int ceph_arch_intel_probe(void)
return 0;
}
-#else // __LP64__
+#else // __x86_64__
int ceph_arch_intel_probe(void)
{
@@ -43,4 +42,4 @@ int ceph_arch_intel_probe(void)
return 0;
}
-#endif // __LP64__
+#endif // __x86_64__
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index 1f616e2c970..1443fabdcd4 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -522,7 +522,7 @@ OPTION(osd_recovery_op_warn_multiple, OPT_U32, 16)
OPTION(osd_mon_shutdown_timeout, OPT_DOUBLE, 5)
OPTION(osd_max_object_size, OPT_U64, 100*1024L*1024L*1024L) // OSD's maximum object size
-OPTION(osd_max_attr_size, OPT_U64, 65536)
+OPTION(osd_max_attr_size, OPT_U64, 0)
OPTION(filestore, OPT_BOOL, false)
diff --git a/src/common/crc32c_intel_fast.h b/src/common/crc32c_intel_fast.h
index 7a394a0b82c..26a444f6061 100644
--- a/src/common/crc32c_intel_fast.h
+++ b/src/common/crc32c_intel_fast.h
@@ -8,7 +8,7 @@ extern "C" {
/* is the fast version compiled in */
extern int ceph_crc32c_intel_fast_exists(void);
-#ifdef __LP64__
+#ifdef __x86_64__
extern uint32_t ceph_crc32c_intel_fast(uint32_t crc, unsigned char const *buffer, unsigned len);
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index df614eedb92..f4fe49bf8de 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -179,32 +179,49 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
}
// walk through incrementals
- MonitorDBStore::Transaction t;
+ MonitorDBStore::Transaction *t = NULL;
+ size_t tx_size = 0;
while (version > osdmap.epoch) {
bufferlist inc_bl;
int err = get_version(osdmap.epoch+1, inc_bl);
assert(err == 0);
assert(inc_bl.length());
-
+
dout(7) << "update_from_paxos applying incremental " << osdmap.epoch+1 << dendl;
OSDMap::Incremental inc(inc_bl);
err = osdmap.apply_incremental(inc);
assert(err == 0);
+ if (t == NULL)
+ t = new MonitorDBStore::Transaction;
+
// write out the full map for all past epochs
bufferlist full_bl;
osdmap.encode(full_bl);
- put_version_full(&t, osdmap.epoch, full_bl);
+ tx_size += full_bl.length();
+
+ put_version_full(t, osdmap.epoch, full_bl);
+ put_version_latest_full(t, osdmap.epoch);
// share
dout(1) << osdmap << dendl;
if (osdmap.epoch == 1) {
- t.erase("mkfs", "osdmap");
+ t->erase("mkfs", "osdmap");
+ }
+
+ if (tx_size > g_conf->mon_sync_max_payload_size*2) {
+ mon->store->apply_transaction(*t);
+ delete t;
+ t = NULL;
+ tx_size = 0;
}
}
- if (!t.empty())
- mon->store->apply_transaction(t);
+
+ if (t != NULL) {
+ mon->store->apply_transaction(*t);
+ delete t;
+ }
for (int o = 0; o < osdmap.get_max_osd(); o++) {
if (osdmap.is_down(o)) {
@@ -3001,7 +3018,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
cmd_getval(g_ceph_context, cmdmap, "weight", w);
err = newcrush.adjust_item_weightf(g_ceph_context, id, w);
- if (err == 0) {
+ if (err >= 0) {
pending_inc.crush.clear();
newcrush.encode(pending_inc.crush);
ss << "reweighted item id " << id << " name '" << name << "' to " << w
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index a48372fe561..7d1738da572 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -2960,7 +2960,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
case CEPH_OSD_OP_SETXATTR:
++ctx->num_write;
{
- if (op.xattr.value_len > cct->_conf->osd_max_attr_size) {
+ if (cct->_conf->osd_max_attr_size > 0 &&
+ op.xattr.value_len > cct->_conf->osd_max_attr_size) {
result = -EFBIG;
break;
}
@@ -4260,6 +4261,7 @@ void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r)
issue_repop(repop, repop->ctx->mtime);
eval_repop(repop);
+ repop->put();
dout(10) << __func__ << " fetching more" << dendl;
_copy_some(ctx, cop);
@@ -4979,6 +4981,7 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch)
// obc ref swallowed by repop!
issue_repop(repop, repop->ctx->mtime);
eval_repop(repop);
+ repop->put();
}
ObjectContextRef ReplicatedPG::create_object_context(const object_info_t& oi,
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index a3127be9455..bf036c914c8 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -66,8 +66,7 @@ endif
bin_PROGRAMS += ceph-dencoder
get_command_descriptions_SOURCES = test/common/get_command_descriptions.cc
-get_command_descriptions_CXXFLAGS = $(UNITTEST_CXXFLAGS)
-get_command_descriptions_LDADD = $(LIBMON) $(LIBCOMMON) $(UNITTEST_LDADD) $(CEPH_GLOBAL)
+get_command_descriptions_LDADD = $(LIBMON) $(LIBCOMMON) $(CEPH_GLOBAL)
noinst_PROGRAMS += get_command_descriptions
diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc
index 803c8b1cc77..20847e7b8b9 100644
--- a/src/test/librados/misc.cc
+++ b/src/test/librados/misc.cc
@@ -538,21 +538,25 @@ TEST(LibRadosMisc, BigAttrPP) {
bufferlist got;
- bl.clear();
- got.clear();
- bl.append(buffer::create(g_conf->osd_max_attr_size));
- ASSERT_EQ(0, ioctx.setxattr("foo", "one", bl));
- ASSERT_EQ((int)bl.length(), ioctx.getxattr("foo", "one", got));
- ASSERT_TRUE(bl.contents_equal(got));
+ if (g_conf->osd_max_attr_size) {
+ bl.clear();
+ got.clear();
+ bl.append(buffer::create(g_conf->osd_max_attr_size));
+ ASSERT_EQ(0, ioctx.setxattr("foo", "one", bl));
+ ASSERT_EQ((int)bl.length(), ioctx.getxattr("foo", "one", got));
+ ASSERT_TRUE(bl.contents_equal(got));
- bl.clear();
- bl.append(buffer::create(g_conf->osd_max_attr_size+1));
- ASSERT_EQ(-EFBIG, ioctx.setxattr("foo", "one", bl));
+ bl.clear();
+ bl.append(buffer::create(g_conf->osd_max_attr_size+1));
+ ASSERT_EQ(-EFBIG, ioctx.setxattr("foo", "one", bl));
+ } else {
+ cout << "osd_max_attr_size == 0; skipping test" << std::endl;
+ }
for (int i=0; i<1000; i++) {
bl.clear();
got.clear();
- bl.append(buffer::create(g_conf->osd_max_attr_size));
+ bl.append(buffer::create(MIN(g_conf->osd_max_attr_size, 1024)));
char n[10];
snprintf(n, sizeof(n), "a%d", i);
ASSERT_EQ(0, ioctx.setxattr("foo", n, bl));