From: kungf Date: Tue, 20 Nov 2018 02:29:10 +0000 (+0800) Subject: journal: allow remove set when jounal pool is full X-Git-Tag: v14.1.0~715^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=abcef94819b5f00bee1ac0f209d6265338bd94b1;p=ceph.git journal: allow remove set when jounal pool is full Signed-off-by: kungf --- diff --git a/src/journal/JournalTrimmer.cc b/src/journal/JournalTrimmer.cc index d3289499a090..645a62304c5f 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 4ad154bd1dcc..78a290a3ac5e 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 448575a334df..e92d7dfa505f 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 8b64786add72..9e160015ff06 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 e15eee561355..f083230c89eb 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;