Skip to content

Commit

Permalink
Merge pull request #9317 from Abhishekvrshny/wip-15956-jewel
Browse files Browse the repository at this point in the history
jewel: rbd-mirror should disable the rbd cache for local images

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed May 31, 2016
2 parents cd6ed4d + 0c99028 commit 409fc64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/rbd_mirror/test_ImageReplayer.cc
Expand Up @@ -74,13 +74,15 @@ class TestImageReplayer : public ::testing::Test {
TestImageReplayer() : m_watch_handle(0)
{
EXPECT_EQ("", connect_cluster_pp(m_local_cluster));
EXPECT_EQ(0, m_local_cluster.conf_set("rbd_cache", "false"));

m_local_pool_name = get_temp_pool_name();
EXPECT_EQ(0, m_local_cluster.pool_create(m_local_pool_name.c_str()));
EXPECT_EQ(0, m_local_cluster.ioctx_create(m_local_pool_name.c_str(),
m_local_ioctx));

EXPECT_EQ("", connect_cluster_pp(m_remote_cluster));
EXPECT_EQ(0, m_remote_cluster.conf_set("rbd_cache", "false"));

m_remote_pool_name = get_temp_pool_name();
EXPECT_EQ(0, m_remote_cluster.pool_create(m_remote_pool_name.c_str()));
Expand Down
1 change: 1 addition & 0 deletions src/test/rbd_mirror/test_fixture.cc
Expand Up @@ -23,6 +23,7 @@ TestFixture::TestFixture() {

void TestFixture::SetUpTestCase() {
ASSERT_EQ("", connect_cluster_pp(_rados));
ASSERT_EQ(0, _rados.conf_set("rbd_cache", "false"));

_local_pool_name = get_temp_pool_name("test-rbd-mirror-");
ASSERT_EQ(0, _rados.pool_create(_local_pool_name.c_str()));
Expand Down
2 changes: 2 additions & 0 deletions src/tools/rbd_mirror/Replayer.cc
Expand Up @@ -304,6 +304,8 @@ int Replayer::init()
}
}

// disable unnecessary librbd cache
cct->_conf->set_val_or_die("rbd_cache", "false");
cct->_conf->apply_changes(nullptr);
cct->_conf->complain_about_parse_errors(cct);

Expand Down
3 changes: 3 additions & 0 deletions src/tools/rbd_mirror/main.cc
Expand Up @@ -61,6 +61,9 @@ int main(int argc, const char **argv)
std::vector<const char*> cmd_args;
argv_to_vec(argc, argv, cmd_args);

// disable unnecessary librbd cache
g_ceph_context->_conf->set_val_or_die("rbd_cache", "false");

mirror = new rbd::mirror::Mirror(g_ceph_context, cmd_args);
int r = mirror->init();
if (r < 0) {
Expand Down

0 comments on commit 409fc64

Please sign in to comment.