]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge remote-tracking branch 'gh/next'
authorSage Weil <sage@redhat.com>
Wed, 13 Aug 2014 21:10:31 +0000 (14:10 -0700)
committerSage Weil <sage@redhat.com>
Wed, 13 Aug 2014 21:10:31 +0000 (14:10 -0700)
1  2 
src/librbd/internal.cc
src/osd/OSD.cc
src/osd/OSD.h
src/osd/ReplicatedPG.cc
src/test/librados/tier.cc
src/test/pybind/test_rbd.py

Simple merge
diff --cc src/osd/OSD.cc
index 5f0635b0ef060f7920ec4989469b2620f034bfc9,15f4000cc634b4d2d21c7a7761b7736a67bf92f8..a6568d0526e7223da54e345ec74df7525803e7a4
@@@ -6780,13 -6710,15 +6783,15 @@@ bool OSD::require_same_peer_instance(Op
                                map->get_cluster_addr(from) : entity_addr_t())
            << dendl;
      ConnectionRef con = m->get_connection();
 -    cluster_messenger->mark_down(con.get());
 +    con->mark_down();
      Session *s = static_cast<Session*>(con->get_priv());
      if (s) {
-       s->session_dispatch_lock.Lock();
+       if (!is_fast_dispatch)
+       s->session_dispatch_lock.Lock();
        clear_session_waiting_on_map(s);
        con->set_priv(NULL);   // break ref <-> session cycle, if any
-       s->session_dispatch_lock.Unlock();
+       if (!is_fast_dispatch)
+       s->session_dispatch_lock.Unlock();
        s->put();
      }
      return false;
diff --cc src/osd/OSD.h
Simple merge
Simple merge
index c2bd5feb86ebb4e6802a8017a4ad917802e69161,4267389578229735c4abacde8069da3f4c172413..ad30d2516c210400643118403650383709a0bb6f
@@@ -2193,98 -2076,8 +2076,93 @@@ TEST_F(LibRadosTwoPoolsPP, HitSetTrim) 
  
      sleep(1);
    }
-   ASSERT_EQ(0, cluster.mon_command(
-     "{\"prefix\": \"osd tier remove\", \"pool\": \"" + pool_name +
-     "\", \"tierpool\": \"" + cache_pool_name + "\"}",
-     inbl, NULL, NULL));
  }
  
 +TEST_F(LibRadosTwoPoolsPP, PromoteOn2ndRead) {
 +  // create object
 +  {
 +    bufferlist bl;
 +    bl.append("hi there");
 +    ObjectWriteOperation op;
 +    op.write_full(bl);
 +    ASSERT_EQ(0, ioctx.operate("foo", &op));
 +  }
 +
 +  // configure cache
 +  bufferlist inbl;
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier add\", \"pool\": \"" + pool_name +
 +    "\", \"tierpool\": \"" + cache_pool_name +
 +    "\", \"force_nonempty\": \"--force-nonempty\" }",
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier set-overlay\", \"pool\": \"" + pool_name +
 +    "\", \"overlaypool\": \"" + cache_pool_name + "\"}",
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier cache-mode\", \"pool\": \"" + cache_pool_name +
 +    "\", \"mode\": \"writeback\"}",
 +    inbl, NULL, NULL));
 +
 +  // enable hitset tracking for this pool
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "hit_set_count", 2),
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "hit_set_period", 600),
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "hit_set_type", "bloom"),
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "min_read_recency_for_promote", 1),
 +    inbl, NULL, NULL));
 +
 +  // wait for maps to settle
 +  cluster.wait_for_latest_osdmap();
 +
 +  // 1st read, don't trigger a promote
 +  {
 +    bufferlist bl;
 +    ASSERT_EQ(1, ioctx.read("foo", bl, 1, 0));
 +  }
 +
 +  // verify the object is NOT present in the cache tier
 +  {
 +    ObjectIterator it = cache_ioctx.objects_begin();
 +    ASSERT_TRUE(it == cache_ioctx.objects_end());
 +  }
 +
 +  // Read until the object is present in the cache tier
 +  while (true) {
 +    bufferlist bl;
 +    ASSERT_EQ(1, ioctx.read("foo", bl, 1, 0));
 +
 +    ObjectIterator it = cache_ioctx.objects_begin();
 +    if (it != cache_ioctx.objects_end()) {
 +      ASSERT_TRUE(it->first == string("foo"));
 +      ++it;
 +      ASSERT_TRUE(it == cache_ioctx.objects_end());
 +      break;
 +    }
 +
 +    sleep(1);
 +  }
 +
 +  // tear down tiers
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier remove-overlay\", \"pool\": \"" + pool_name +
 +    "\"}",
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier remove\", \"pool\": \"" + pool_name +
 +    "\", \"tierpool\": \"" + cache_pool_name + "\"}",
 +    inbl, NULL, NULL));
 +
 +  // wait for maps to settle before next test
 +  cluster.wait_for_latest_osdmap();
 +}
 +
  class LibRadosTwoPoolsECPP : public RadosTestECPP
  {
  public:
@@@ -4275,98 -3941,8 +4026,93 @@@ TEST_F(LibRadosTwoPoolsECPP, HitSetTrim
      sleep(1);
    }
    delete[] buf;
-   ASSERT_EQ(0, cluster.mon_command(
-     "{\"prefix\": \"osd tier remove\", \"pool\": \"" + pool_name +
-     "\", \"tierpool\": \"" + cache_pool_name + "\"}",
-     inbl, NULL, NULL));
  }
  
 +TEST_F(LibRadosTwoPoolsECPP, PromoteOn2ndRead) {
 +  // create object
 +  {
 +    bufferlist bl;
 +    bl.append("hi there");
 +    ObjectWriteOperation op;
 +    op.write_full(bl);
 +    ASSERT_EQ(0, ioctx.operate("foo", &op));
 +  }
 +
 +  // configure cache
 +  bufferlist inbl;
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier add\", \"pool\": \"" + pool_name +
 +    "\", \"tierpool\": \"" + cache_pool_name +
 +    "\", \"force_nonempty\": \"--force-nonempty\" }",
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier set-overlay\", \"pool\": \"" + pool_name +
 +    "\", \"overlaypool\": \"" + cache_pool_name + "\"}",
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier cache-mode\", \"pool\": \"" + cache_pool_name +
 +    "\", \"mode\": \"writeback\"}",
 +    inbl, NULL, NULL));
 +
 +  // enable hitset tracking for this pool
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "hit_set_count", 2),
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "hit_set_period", 600),
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "hit_set_type", "bloom"),
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    set_pool_str(cache_pool_name, "min_read_recency_for_promote", 1),
 +    inbl, NULL, NULL));
 +
 +  // wait for maps to settle
 +  cluster.wait_for_latest_osdmap();
 +
 +  // 1st read, don't trigger a promote
 +  {
 +    bufferlist bl;
 +    ASSERT_EQ(1, ioctx.read("foo", bl, 1, 0));
 +  }
 +
 +  // verify the object is NOT present in the cache tier
 +  {
 +    ObjectIterator it = cache_ioctx.objects_begin();
 +    ASSERT_TRUE(it == cache_ioctx.objects_end());
 +  }
 +
 +  // Read until the object is present in the cache tier
 +  while (true) {
 +    bufferlist bl;
 +    ASSERT_EQ(1, ioctx.read("foo", bl, 1, 0));
 +
 +    ObjectIterator it = cache_ioctx.objects_begin();
 +    if (it != cache_ioctx.objects_end()) {
 +      ASSERT_TRUE(it->first == string("foo"));
 +      ++it;
 +      ASSERT_TRUE(it == cache_ioctx.objects_end());
 +      break;
 +    }
 +
 +    sleep(1);
 +  }
 +
 +  // tear down tiers
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier remove-overlay\", \"pool\": \"" + pool_name +
 +    "\"}",
 +    inbl, NULL, NULL));
 +  ASSERT_EQ(0, cluster.mon_command(
 +    "{\"prefix\": \"osd tier remove\", \"pool\": \"" + pool_name +
 +    "\", \"tierpool\": \"" + cache_pool_name + "\"}",
 +    inbl, NULL, NULL));
 +
 +  // wait for maps to settle before next test
 +  cluster.wait_for_latest_osdmap();
 +}
 +
  int main(int argc, char **argv)
  {
    ::testing::InitGoogleTest(&argc, argv);
Simple merge