Merge pull request #25166 from kungf/journal_remove_full

journal: allow remove set when jounal pool is full

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2018-12-05 13:25:31 -05:00 committed by GitHub
commit 241896c660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 4 deletions

View File

@ -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();
}

View File

@ -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<TestIoCtxImpl*>(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<TestIoCtxImpl*>(io_ctx_impl);

View File

@ -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);

View File

@ -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()),

View File

@ -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;