try:
background.wait()
except CommandFailedError:
- # command failed with EBLACKLISTED?
+ # command failed with EBLOCKLISTED?
if "transport endpoint shutdown" in background.stderr.getvalue():
pass
else:
if (r < 0) {
if (r == -ENOENT) {
ldout(m_cct, 5) << __func__ << ": journal header not found" << dendl;
- } else if (r == -EBLACKLISTED) {
+ } else if (r == -EBLOCKLISTED) {
ldout(m_cct, 5) << __func__ << ": client blocklisted" << dendl;
} else {
lderr(m_cct) << __func__ << ": failed to watch journal: "
ldout(cct, 20) << __func__ << ": r=" << r << dendl;
if (r < 0) {
- complete(r == -EBLACKLISTED ? -EBLACKLISTED : -EROFS);
+ complete(r == -EBLOCKLISTED ? -EBLOCKLISTED : -EROFS);
return;
}
ceph_assert(ceph_mutex_is_locked(dispatcher->m_cache_lock));
auto cct = dispatcher->m_image_ctx->cct;
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
lderr(cct) << "blocklisted during flush (purging)" << dendl;
dispatcher->m_object_cacher->purge_set(dispatcher->m_object_set);
} else if (r < 0 && purge_on_error) {
CephContext *cct = m_image_ctx.cct;
ldout(cct, 10) << "r=" << r << dendl;
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
// allow clean shut down if blocklisted
lderr(cct) << "failed to block writes because client is blocklisted"
<< dendl;
CephContext *cct = reinterpret_cast<CephContext *>(m_ioctx.cct());
ldout(cct, 10) << "r=" << r << dendl;
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
lderr(cct) << "client blocklisted" << dendl;
finish(r);
return;
MDSRank *mds = get_mds();
// assume journal is reliable, so don't choose action based on
// g_conf()->mds_action_on_write_error.
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
derr << "we have been blocklisted (fenced), respawning..." << dendl;
mds->respawn();
} else {
return;
}
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
derr << "MDSIOContextBase: blocklisted! Restarting..." << dendl;
mds->respawn();
} else {
void MDSRank::handle_write_error(int err)
{
- if (err == -EBLACKLISTED) {
+ if (err == -EBLOCKLISTED) {
derr << "we have been blocklisted (fenced), respawning..." << dendl;
respawn();
return;
{
ceph_assert(is_opening());
state = STATE_ACTIVE;
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
mds->respawn();
return;
}
new LambdaContext([this, expire_to](int r){
std::lock_guard l(lock);
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
finisher.queue(on_error, r);
on_error = nullptr;
return;
if (r != 0) {
dout(0) << "recovery error! " << r << dendl;
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
mds->respawn();
return;
} else {
expect_write(mock_dst_io_ctx, 0, one.range_end(), {0, {}}, 0);
expect_start_op(mock_exclusive_lock);
expect_update_object_map(mock_dst_image_ctx, mock_object_map,
- m_dst_snap_ids[0], OBJECT_EXISTS, -EBLACKLISTED);
+ m_dst_snap_ids[0], OBJECT_EXISTS, -EBLOCKLISTED);
request->send();
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
}
TEST_F(TestMockDeepCopyObjectCopyRequest, WriteSnapsStart) {
expect_prepare_lock(mock_image_ctx);
expect_cancel_op_requests(mock_image_ctx, 0);
MockImageDispatch mock_image_dispatch;
- expect_set_require_lock(mock_image_ctx, mock_image_dispatch, -EBLACKLISTED);
+ expect_set_require_lock(mock_image_ctx, mock_image_dispatch, -EBLOCKLISTED);
cache::MockImageCache mock_image_cache;
mock_image_ctx.image_cache = &mock_image_cache;
MockShutdownRequest mock_shutdown_request;
expect_close_image_cache(mock_image_ctx, mock_shutdown_request, 0);
- expect_invalidate_cache(mock_image_ctx, -EBLACKLISTED);
+ expect_invalidate_cache(mock_image_ctx, -EBLOCKLISTED);
expect_flush_notifies(mock_image_ctx);
MockJournal mock_journal;
mock_image_ctx.journal = &mock_journal;
- expect_close_journal(mock_image_ctx, mock_journal, -EBLACKLISTED);
+ expect_close_journal(mock_image_ctx, mock_journal, -EBLOCKLISTED);
MockObjectMap mock_object_map;
mock_image_ctx.object_map = &mock_object_map;
expect_apply_metadata(mock_image_ctx, 0);
expect_get_group(mock_image_ctx, 0);
expect_refresh_parent_is_required(mock_refresh_parent_request, false);
- expect_open_object_map(mock_image_ctx, &mock_object_map, -EBLACKLISTED);
+ expect_open_object_map(mock_image_ctx, &mock_object_map, -EBLOCKLISTED);
EXPECT_CALL(mock_image_ctx, rebuild_data_io_context());
C_SaferCond ctx;
&ctx);
req->send();
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
ASSERT_EQ(nullptr, mock_image_ctx.object_map);
}
expect_get_parent_overlap(mock_image_ctx, CEPH_NOSNAP, 0, 0);
expect_object_may_exist(mock_image_ctx, 0, true);
expect_object_map_update(mock_image_ctx, 0, 1, OBJECT_EXISTS, {}, true,
- -EBLACKLISTED);
+ -EBLOCKLISTED);
C_SaferCond ctx;
auto req = MockObjectWriteRequest::create_write(
&mock_image_ctx, 0, 0, std::move(bl), mock_image_ctx.snapc, 0, 0,
std::nullopt, {}, &ctx);
req->send();
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
}
} // namespace io
InSequence seq;
expect_aio_watch(mock_image_ctx, 0);
expect_aio_unwatch(mock_image_ctx, 0);
- expect_aio_watch(mock_image_ctx, -EBLACKLISTED);
+ expect_aio_watch(mock_image_ctx, -EBLOCKLISTED);
C_SaferCond register_ctx;
mock_image_watcher.register_watch(®ister_ctx);
ASSERT_EQ(0, register_ctx.wait());
ceph_assert(m_watch_ctx != nullptr);
- m_watch_ctx->handle_error(0, -EBLACKLISTED);
+ m_watch_ctx->handle_error(0, -EBLOCKLISTED);
// wait for recovery unwatch/watch
ASSERT_TRUE(wait_for_watch(mock_image_ctx, 2));
InSequence seq;
expect_aio_unwatch(mock_image_ctx, 0);
- expect_aio_watch(mock_image_ctx, -EBLACKLISTED);
+ expect_aio_watch(mock_image_ctx, -EBLOCKLISTED);
C_SaferCond ctx;
MockRewatchRequest *req = MockRewatchRequest::create(mock_image_ctx.md_ctx,
std::unique_lock watch_locker{m_watch_lock};
req->send();
}
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
ASSERT_EQ(0U, m_watch_handle);
}
expect_work_queue(mock_threads);
InSequence seq;
- expect_create_trash(m_local_io_ctx, -EBLACKLISTED);
+ expect_create_trash(m_local_io_ctx, -EBLOCKLISTED);
MockListener mock_listener;
MockTrashWatcher mock_trash_watcher(m_local_io_ctx, &mock_threads,
mock_listener);
C_SaferCond ctx;
mock_trash_watcher.init(&ctx);
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
MockLibrbdTrashWatcher mock_librbd_trash_watcher;
expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
MockLibrbdTrashWatcher mock_librbd_trash_watcher;
expect_trash_watcher_is_unregistered(mock_librbd_trash_watcher, true);
- expect_trash_watcher_register(mock_librbd_trash_watcher, -EBLACKLISTED);
+ expect_trash_watcher_register(mock_librbd_trash_watcher, -EBLOCKLISTED);
MockListener mock_listener;
MockTrashWatcher mock_trash_watcher(m_local_io_ctx, &mock_threads,
mock_listener);
C_SaferCond ctx;
mock_trash_watcher.init(&ctx);
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
ASSERT_EQ(0, when_shut_down(mock_trash_watcher));
MockLibrbdTrashWatcher mock_librbd_trash_watcher;
expect_trash_watcher_is_unregistered(mock_librbd_trash_watcher, true);
expect_trash_watcher_register(mock_librbd_trash_watcher, 0);
- expect_trash_list(m_local_io_ctx, "", {}, -EBLACKLISTED);
+ expect_trash_list(m_local_io_ctx, "", {}, -EBLOCKLISTED);
MockListener mock_listener;
MockTrashWatcher mock_trash_watcher(m_local_io_ctx, &mock_threads,
mock_listener);
C_SaferCond ctx;
mock_trash_watcher.init(&ctx);
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
ASSERT_EQ(0, when_shut_down(mock_trash_watcher));
mock_trash_watcher.init(&ctx);
ASSERT_EQ(0, ctx.wait());
- LibrbdTrashWatcher::get_instance().handle_rewatch_complete(-EBLACKLISTED);
+ LibrbdTrashWatcher::get_instance().handle_rewatch_complete(-EBLOCKLISTED);
m_threads->work_queue->drain();
expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
&shuffle_global_image_ids);
ASSERT_TRUE(shuffle_global_image_ids.empty());
- ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLACKLISTED));
+ ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLOCKLISTED));
ASSERT_EQ(ACTION_TYPE_RELEASE, m_policy->start_action(global_image_id));
ASSERT_TRUE(m_policy->finish_action(global_image_id, -ENOENT));
m_policy->remove_instances({"9876"}, &shuffle_global_image_ids);
ASSERT_TRUE(shuffle_global_image_ids.empty());
- ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLACKLISTED));
+ ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLOCKLISTED));
ASSERT_EQ(ACTION_TYPE_RELEASE, m_policy->start_action(global_image_id));
ASSERT_TRUE(m_policy->finish_action(global_image_id, 0));
m_policy->remove_instances({"9876"}, &shuffle_global_image_ids);
ASSERT_TRUE(shuffle_global_image_ids.empty());
- ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLACKLISTED));
+ ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLOCKLISTED));
ASSERT_EQ(ACTION_TYPE_RELEASE, m_policy->start_action(global_image_id));
ASSERT_TRUE(m_policy->finish_action(global_image_id, 0));
remote_peer_ack_nowait(mock_image_map.get(), shuffled_global_image_ids,
-ENOENT, &peer_ack_remove_ctxs);
remote_peer_ack_wait(mock_image_map.get(), shuffled_global_image_ids,
- -EBLACKLISTED, &peer_ack_ctxs);
+ -EBLOCKLISTED, &peer_ack_ctxs);
wait_for_scheduled_task();
ASSERT_EQ(0, when_shut_down(mock_image_map.get()));
InSequence seq;
MockMirroringWatcher mock_mirroring_watcher;
expect_mirroring_watcher_is_unregistered(mock_mirroring_watcher, true);
- expect_mirroring_watcher_register(mock_mirroring_watcher, -EBLACKLISTED);
+ expect_mirroring_watcher_register(mock_mirroring_watcher, -EBLOCKLISTED);
MockListener mock_listener(this);
MockPoolWatcher mock_pool_watcher(&mock_threads, m_remote_io_ctx,
"remote uuid", mock_listener);
C_SaferCond ctx;
mock_pool_watcher.init(&ctx);
- ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+ ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
ASSERT_TRUE(mock_pool_watcher.is_blocklisted());
expect_mirroring_watcher_unregister(mock_mirroring_watcher, 0);
void TrashWatcher<I>::handle_rewatch_complete(int r) {
dout(5) << "r=" << r << dendl;
- if (r == -EBLACKLISTED) {
+ if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted" << dendl;
return;
} else if (r == -ENOENT) {