From abcef94819b5f00bee1ac0f209d6265338bd94b1 Mon Sep 17 00:00:00 2001 From: kungf Date: Tue, 20 Nov 2018 10:29:10 +0800 Subject: [PATCH] journal: allow remove set when jounal pool is full Signed-off-by: kungf --- src/journal/JournalTrimmer.cc | 3 ++- src/test/librados_test_stub/LibradosTestStub.cc | 5 +++++ src/test/librados_test_stub/TestIoCtxImpl.h | 3 ++- src/test/librados_test_stub/TestMemIoCtxImpl.cc | 2 +- src/test/librados_test_stub/TestMemIoCtxImpl.h | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/journal/JournalTrimmer.cc b/src/journal/JournalTrimmer.cc index d3289499a09..645a62304c5 100644 --- a/src/journal/JournalTrimmer.cc +++ b/src/journal/JournalTrimmer.cc @@ -139,7 +139,8 @@ void JournalTrimmer::remove_set(uint64_t object_set) { librados::AioCompletion *comp = librados::Rados::aio_create_completion(ctx, NULL, utils::rados_ctx_callback); - int r = m_ioctx.aio_remove(oid, comp); + int r = m_ioctx.aio_remove(oid, comp, + CEPH_OSD_FLAG_FULL_FORCE | CEPH_OSD_FLAG_FULL_TRY); ceph_assert(r == 0); comp->release(); } diff --git a/src/test/librados_test_stub/LibradosTestStub.cc b/src/test/librados_test_stub/LibradosTestStub.cc index 4ad154bd1dc..78a290a3ac5 100644 --- a/src/test/librados_test_stub/LibradosTestStub.cc +++ b/src/test/librados_test_stub/LibradosTestStub.cc @@ -475,6 +475,11 @@ int IoCtx::aio_remove(const std::string& oid, AioCompletion *c) { return ctx->aio_remove(oid, c->pc); } +int IoCtx::aio_remove(const std::string& oid, AioCompletion *c, int flags) { + TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); + return ctx->aio_remove(oid, c->pc, flags); +} + int IoCtx::aio_watch(const std::string& o, AioCompletion *c, uint64_t *handle, librados::WatchCtx2 *watch_ctx) { TestIoCtxImpl *ctx = reinterpret_cast(io_ctx_impl); diff --git a/src/test/librados_test_stub/TestIoCtxImpl.h b/src/test/librados_test_stub/TestIoCtxImpl.h index 448575a334d..e92d7dfa505 100644 --- a/src/test/librados_test_stub/TestIoCtxImpl.h +++ b/src/test/librados_test_stub/TestIoCtxImpl.h @@ -90,7 +90,8 @@ public: virtual int aio_operate_read(const std::string& oid, TestObjectOperationImpl &ops, AioCompletionImpl *c, int flags, bufferlist *pbl); - virtual int aio_remove(const std::string& oid, AioCompletionImpl *c) = 0; + virtual int aio_remove(const std::string& oid, AioCompletionImpl *c, + int flags = 0) = 0; virtual int aio_watch(const std::string& o, AioCompletionImpl *c, uint64_t *handle, librados::WatchCtx2 *ctx); virtual int aio_unwatch(uint64_t handle, AioCompletionImpl *c); diff --git a/src/test/librados_test_stub/TestMemIoCtxImpl.cc b/src/test/librados_test_stub/TestMemIoCtxImpl.cc index 8b64786add7..9e160015ff0 100644 --- a/src/test/librados_test_stub/TestMemIoCtxImpl.cc +++ b/src/test/librados_test_stub/TestMemIoCtxImpl.cc @@ -46,7 +46,7 @@ TestIoCtxImpl *TestMemIoCtxImpl::clone() { return new TestMemIoCtxImpl(*this); } -int TestMemIoCtxImpl::aio_remove(const std::string& oid, AioCompletionImpl *c) { +int TestMemIoCtxImpl::aio_remove(const std::string& oid, AioCompletionImpl *c, int flags) { m_client->add_aio_operation(oid, true, boost::bind(&TestMemIoCtxImpl::remove, this, oid, get_snap_context()), diff --git a/src/test/librados_test_stub/TestMemIoCtxImpl.h b/src/test/librados_test_stub/TestMemIoCtxImpl.h index e15eee56135..f083230c89e 100644 --- a/src/test/librados_test_stub/TestMemIoCtxImpl.h +++ b/src/test/librados_test_stub/TestMemIoCtxImpl.h @@ -21,7 +21,7 @@ public: TestIoCtxImpl *clone() override; - int aio_remove(const std::string& oid, AioCompletionImpl *c) override; + int aio_remove(const std::string& oid, AioCompletionImpl *c, int flags = 0) override; int append(const std::string& oid, const bufferlist &bl, const SnapContext &snapc) override;