action: create / clone / none (optional, defaults to create)
image_name: <image name> (optional)
parent_name: <parent_name> (if action == clone),
- type: filesystem / block (optional, defaults to fileystem)
+ type: filesystem / block (optional, defaults to filesystem)
image_url: <URL> (optional),
image_size: <MiB> (optional)
encryption_format: luks1 / luks2 / none (optional, defaults to none)
def run_fio(remote, config, rbd_test_dir):
"""
create fio config file with options based on above config
- get the fio from github, generate binary, and use it to run on
+ get the fio from GitHub, generate binary, and use it to run on
the generated fio config file
"""
fio_config=NamedTemporaryFile(mode='w', prefix='fio_rbd_', dir='/tmp/', delete=False)
# the background.
#
# An iteration of the test consists of performing some number of
-# passes, initating each pass as a background job, and finally
+# passes, initiating each pass as a background job, and finally
# sleeping for a variable delay. The delay is initially a specified
# value, but each iteration shortens that proportionally, such that
# the last iteration will not delay at all.
echo " object order is ${OBJECT_ORDER}, so" \
"objects are ${OBJECT_SIZE} bytes"
echo " page size is ${PAGE_SIZE} bytes, so" \
- "there are are ${OBJECT_PAGES} pages in an object"
+ "there are ${OBJECT_PAGES} pages in an object"
echo " derived image size is ${IMAGE_SIZE} MB, so" \
"there are ${IMAGE_OBJECTS} objects in an image"
if [ "${TEST_CLONES}" = true ]; then
--network network=default,model=virtio \
--controller type=virtio-serial \
--channel unix,target_type=virtio,name=org.qemu.guest_agent.0 \
- --noautoconsol
+ --noautoconsole
export SSH_USER="administrator"
export SSH_KNOWN_HOSTS_FILE="${DIR}/known_hosts"
try:
test_cls = TESTS[args.test_name]
except KeyError:
- raise CephTestException("Unkown test: {}".format(args.test_name))
+ raise CephTestException("Unknown test: {}".format(args.test_name))
runner = TestRunner(
test_cls,
}
/**
- * set the proctection status of a snapshot
+ * set the protection status of a snapshot
*
* Input:
* @param snapid (uint64_t) which snapshot to set the status of
* Rename an image in the directory, updating both indexes
* atomically. This can't be done from the client calling
* dir_add_image and dir_remove_image in one transaction because the
- * results of the first method are not visibale to later steps.
+ * results of the first method are not visible to later steps.
*
* Input:
* @param src original name of the image
/**
* Input:
* @param snap_id: snapshot id
- * @param complete: true if shapshot fully copied/complete
+ * @param complete: true if snapshot fully copied/complete
* @param last_copied_object_number: last copied object number
*
* Output:
- name: rbd_mirror_image_policy_rebalance_timeout
type: float
level: advanced
- desc: number of seconds policy should be idle before trigerring reshuffle (rebalance)
+ desc: number of seconds policy should be idle before triggering reshuffle (rebalance)
of images
default: 0
services:
*/
CEPH_RBD_API int rbd_snap_protect(rbd_image_t image, const char *snap_name);
/**
- * Allow a snaphshot to be deleted.
+ * Allow a snapshot to be deleted.
*
* @param snap_name which snapshot to unprotect
* @returns 0 on success, negative error code on failure
ceph::ref_t<ObjectRecorder> JournalRecorder::get_object(uint8_t splay_offset) {
ceph_assert(ceph_mutex_is_locked(m_lock));
- const auto& object_recoder = m_object_ptrs.at(splay_offset);
- ceph_assert(object_recoder);
- return object_recoder;
+ const auto& object_recorder = m_object_ptrs.at(splay_offset);
+ ceph_assert(object_recorder);
+ return object_recorder;
}
void JournalRecorder::close_and_advance_object_set(uint64_t object_set) {
ceph::condition_variable m_in_flight_callbacks_cond;
uint64_t m_in_flight_bytes = 0;
- bool send_appends(bool force, ceph::ref_t<FutureImpl> flush_sentinal);
+ bool send_appends(bool force, ceph::ref_t<FutureImpl> flush_sentinel);
void handle_append_flushed(uint64_t tid, int r);
void append_overflowed();
// When relinking children we should be careful as it my be interrupted
// at any moment by some reason and we may end up in an inconsistent
// state, which we have to be able to fix with "migration abort". Below
-// are all possible states during migration (P1 - sourse parent, P2 -
+// are all possible states during migration (P1 - source parent, P2 -
// destination parent, C - child):
//
// P1 P2 P1 P2 P1 P2 P1 P2
on_dispatched = util::create_async_context_callback(*m_image_ctx,
on_dispatched);
- // embed the RBD-internal read flags in the genenric RADOS op_flags and
+ // embed the RBD-internal read flags in the generic RADOS op_flags and
op_flags = ((op_flags & ~ObjectCacherWriteback::READ_FLAGS_MASK) |
((read_flags << ObjectCacherWriteback::READ_FLAGS_SHIFT) &
ObjectCacherWriteback::READ_FLAGS_MASK));
}
// complete flushes that were waiting on in-flight IO
- // (and propogate any IO error to first flush)
+ // (and propagate any IO error to first flush)
for (auto& it : finished_flushes) {
ldout(cct, 20) << "completing flush: tid=" << it.first << ", "
<< "r=" << pending_flush_error << dendl;
m_lock.unlock();
// complete flushes that were waiting on in-flight IO
- // (and propogate any IO errors)
+ // (and propagate any IO errors)
for (auto& it : finished_flushes) {
ldout(cct, 20) << "completing flush: tid=" << it.first << dendl;
it.second->complete(pending_flush_error);
plb.add_u64_counter(l_librbd_pwl_cmp, "cmp", "Compare and Write requests");
plb.add_u64_counter(l_librbd_pwl_cmp_bytes, "cmp_bytes", "Compare and Write bytes compared/written");
- plb.add_time_avg(l_librbd_pwl_cmp_latency, "cmp_lat", "Compare and Write latecy");
+ plb.add_time_avg(l_librbd_pwl_cmp_latency, "cmp_lat", "Compare and Write latency");
plb.add_u64_counter(l_librbd_pwl_cmp_fails, "cmp_fails", "Compare and Write compare fails");
plb.add_u64_counter(l_librbd_pwl_internal_flush, "internal_flush", "Flush RWL (write back to OSD)");
if ((!m_cache_state->present) &&
(access(m_log_pool_name.c_str(), F_OK) == 0)) {
ldout(cct, 5) << "There's an existing pool file " << m_log_pool_name
- << ", While there's no cache in the image metatata." << dendl;
+ << ", While there's no cache in the image metadata." << dendl;
if (remove(m_log_pool_name.c_str()) != 0) {
lderr(cct) << "failed to remove the pool file " << m_log_pool_name
<< dendl;
std::lock_guard locker(m_lock);
while (flushed < IN_FLIGHT_FLUSH_WRITE_LIMIT) {
if (m_shutting_down) {
- ldout(cct, 5) << "Flush during shutdown supressed" << dendl;
+ ldout(cct, 5) << "Flush during shutdown suppressed" << dendl;
/* Do flush complete only when all flush ops are finished */
all_clean = !m_flush_ops_in_flight;
break;
mutable ceph::mutex m_log_retire_lock;
/* Hold a read lock on m_entry_reader_lock to add readers to log entry
* bufs. Hold a write lock to prevent readers from being added (e.g. when
- * removing log entrys from the map). No lock required to remove readers. */
+ * removing log entries from the map). No lock required to remove readers. */
mutable RWLock m_entry_reader_lock;
/* Hold m_log_append_lock while appending or retiring log entries. */
mutable ceph::mutex m_log_append_lock;
buffer::ptr cache_bp;
buffer::list cache_bl;
std::atomic<int> bl_refs = {0}; /* The refs held on cache_bp by cache_bl */
- /* Used in WriteLogEntry::get_cache_bl() to syncronize between threads making entries readable */
+ /* Used in WriteLogEntry::get_cache_bl() to synchronize between threads making entries readable */
mutable ceph::mutex m_entry_bl_lock;
virtual void init_cache_bp() {}
* represent the entire block extent of the GenericWriteLogEntry, and the
* WriteLogMapEntry is added to the set.
*
- * The set must not contain overlapping WriteLogMapEntrys. WriteLogMapEntrys
+ * The set must not contain overlapping write log entries. Entries
* in the set that overlap with one being added are adjusted (shrunk, split,
* or removed) before the new entry is added.
*
if (r != 0) {
auto keyslots_end_offset = m_header.get_data_offset();
if (m_offset < keyslots_end_offset) {
- // perhaps we did not feed the the necessary keyslot, retry
+ // perhaps we did not feed the necessary keyslot, retry
auto ctx = create_context_callback<
LoadRequest<I>, &LoadRequest<I>::handle_read_keyslots>(this);
read(keyslots_end_offset, ctx);
for (auto& [write_read_snap_ids, read_op] : m_read_ops) {
auto src_snap_seq = write_read_snap_ids.first;
- // convert the the resulting sparse image extent map to an interval ...
+ // convert the resulting sparse image extent map to an interval ...
auto& image_data_interval = m_dst_data_interval[src_snap_seq];
for (auto [image_offset, image_length] : read_op.image_extent_map) {
image_data_interval.union_insert(image_offset, image_length);
++dst_snap_id_it;
}
- // we should only have the HEAD revision in the the last snap seq
+ // we should only have the HEAD revision in the last snap seq
ceph_assert(snap_ids.empty() || snap_ids[0] != CEPH_NOSNAP);
snap_ids.insert(snap_ids.begin(), it.second);
ImageDispatch<I>::ImageDispatch(I* image_ctx)
: m_image_ctx(image_ctx),
m_lock(ceph::make_shared_mutex(
- util::unique_lock_name("librbd::exclusve_lock::ImageDispatch::m_lock",
+ util::unique_lock_name("librbd::exclusive_lock::ImageDispatch::m_lock",
this))) {
}
* V2_GET_CREATE_TIMESTAMP |
* | |
* v |
- * V2_GET_ACCESS_MODIFIY_TIMESTAMP |
+ * V2_GET_ACCESS_MODIFY_TIMESTAMP |
* | |
* v |
* V2_GET_DATA_POOL --------------> REFRESH
Context *on_finish)
: m_cct(reinterpret_cast<CephContext*>(io_ctx.cct())),
m_on_finish(on_finish) {
- // validatation should occur in default namespace
+ // validation should occur in default namespace
m_io_ctx.dup(io_ctx);
m_io_ctx.set_namespace("");
}
}
// the write/read snapshot id key is not useful for parent images so
- // map the the special-case INITIAL_WRITE_READ_SNAP_IDS key
+ // map the special-case INITIAL_WRITE_READ_SNAP_IDS key
*m_snapshot_delta = {};
auto& intervals = (*m_snapshot_delta)[INITIAL_WRITE_READ_SNAP_IDS];
for (auto& [key, image_extents] : m_parent_snapshot_delta) {
ldout(cct, 20) << "tid=" << tid << dendl;
// The refresh state machine can initiate a flush and it can
- // enable the exclusive-lock which will also attmept to flush.
+ // enable the exclusive-lock which will also attempt to flush.
if (flush_source == FLUSH_SOURCE_REFRESH ||
flush_source == FLUSH_SOURCE_EXCLUSIVE_LOCK_SKIP_REFRESH ||
flush_source == FLUSH_SOURCE_SHUTDOWN) {
return exists;
}
- // A safer verion of snap_exists.
+ // A safer version of snap_exists.
int Image::snap_exists2(const char *snap_name, bool *exists)
{
ImageCtx *ictx = (ImageCtx *)ctx;
// receive the response for this request
m_parser.emplace();
if (work->header_only()) {
- // HEAD requests don't trasfer data but the parser still cares about max
+ // HEAD requests don't transfer data but the parser still cares about max
// content-length
m_header_parser.emplace();
m_header_parser->body_limit(std::numeric_limits<uint64_t>::max());
return;
}
- // translate the lookup table (big-endian -> CPU endianess)
+ // translate the lookup table (big-endian -> CPU endianness)
for (auto idx = 0UL; idx < size; ++idx) {
cluster_offsets[idx] = big_to_native(cluster_offsets[idx]);
}
* v
* STATE_ACQUIRE_EXCLUSIVE_LOCK (skip if not
* | required)
- * | (disbling journaling)
+ * | (disabling journaling)
* \-------------------\
* | |
* | V
* STATE_NOTIFY_UPDATE
* |
* v
- * STATE_REALEASE_EXCLUSIVE_LOCK (skip if not
- * | required)
+ * STATE_RELEASE_EXCLUSIVE_LOCK (skip if not
+ * | required)
* | (unblock writes)
* v
* <finish>
* v (skip if disabled/in-use)
* REMOVE_OBJECT_MAP
* |
- * v (skip if not mirror snpashot)
+ * v (skip if not mirror snapshot)
* REMOVE_IMAGE_STATE
* |
* v (skip if in-use)
def get_return_value(self):
"""
- Get the return value of an asychronous operation
+ Get the return value of an asynchronous operation
The return value is set when the operation is complete.
:param name: the name of the image
:type name: str
:param snapshot: which snapshot to read from
- :type snaphshot: str
+ :type snapshot: str
:param read_only: whether to open the image in read-only mode
:type read_only: bool
:param image_id: the id of the image
:param name: the name of the image
:type name: str
:param snapshot: which snapshot to read from
- :type snaphshot: str
+ :type snapshot: str
:param read_only: whether to open the image in read-only mode
:type read_only: bool
:param image_id: the id of the image
ASSERT_EQ(expected_entries, entries);
}
-TYPED_TEST(TestJournalPlayer, PrefechShutDown) {
+TYPED_TEST(TestJournalPlayer, PrefetchShutDown) {
std::string oid = this->get_temp_oid();
ASSERT_EQ(0, this->create(oid));
delete mock_parent_image_cache;
}
-TEST_F(TestMockParentCacheObjectDispatch, test_disble_interface) {
+TEST_F(TestMockParentCacheObjectDispatch, test_disable_interface) {
librbd::ImageCtx* ictx;
ASSERT_EQ(0, open_image(m_image_name, &ictx));
MockParentImageCacheImageCtx mock_image_ctx(*ictx);
GetMetadataRequest<MockTestImageCtx>* GetMetadataRequest<MockTestImageCtx>::s_instance = nullptr;
-} // namspace image
+} // namespace image
} // namespace librbd
// template definitions
// -*- mode:C++; tab-width:8; c-basic-offset:8; indent-tabs-mode:t -*-
// vim: ts=8 sw=8 smarttab
/*
- * Copyright (C) 1991, NeXT Computer, Inc. All Rights Reserverd.
+ * Copyright (C) 1991, NeXT Computer, Inc. All Rights Reserved.
*
* File: fsx.cc
* Author: Avadis Tevanian, Jr.
* When mapped read/writes are disabled, they are simply converted to normal
* reads and writes. When fallocate/fpunch calls are disabled, they are
* converted to OP_SKIPPED. Hence OP_SKIPPED needs to have a number higher than
- * the operation selction matrix, as does the OP_CLOSEOPEN which is an
+ * the operation selection matrix, as does the OP_CLOSEOPEN which is an
* operation modifier rather than an operation in itself.
*
* Because of the "lite" version, we also need to have different "maximum
int flush_enabled = 0; /* -f flag */
int deep_copy = 0; /* -g flag */
int holebdy = 1; /* -h flag */
-bool journal_replay = false; /* -j flah */
+bool journal_replay = false; /* -j flag */
int keep_on_success = 0; /* -k flag */
int do_fsync = 0; /* -y flag */
unsigned long maxfilelen = 256 * 1024; /* -l flag */
ASSERT_EQ(0, image.close());
}
-TEST_F(TestLibRBD, ConcurentOperations)
+TEST_F(TestLibRBD, ConcurrentOperations)
{
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);
};
} // namespace mirror
-} // namepace rbd
+} // namespace rbd
#endif // CEPH_MOCK_BASE_REQUEST_H
expect_acquire_lock(mock_managed_lock, 0);
ASSERT_EQ(0, instance_watcher2->init());
- // Acquire Image on the the same instance
+ // Acquire Image on the same instance
EXPECT_CALL(mock_instance_replayer1, acquire_image(instance_watcher1, "gid",
_))
.WillOnce(WithArg<2>(CompleteContext(0)));
instance_watcher1->notify_image_acquire(instance_id2, "gid", &on_acquire2);
ASSERT_EQ(0, on_acquire2.wait());
- // Release Image on the the same instance
+ // Release Image on the same instance
EXPECT_CALL(mock_instance_replayer1, release_image("gid", _))
.WillOnce(WithArg<1>(CompleteContext(0)));
C_SaferCond on_release1;
{"mirror", "pool", "peer", "bootstrap", "create"}, {},
"Create a peer bootstrap token to import in a remote cluster", "",
&get_peer_bootstrap_create_arguments, &execute_peer_bootstrap_create);
-Shell::Action action_bootstreap_import(
+Shell::Action action_bootstrap_import(
{"mirror", "pool", "peer", "bootstrap", "import"}, {},
"Import a peer bootstrap token created from a remote cluster", "",
&get_peer_bootstrap_import_arguments, &execute_peer_bootstrap_import);
auto f = formatter.get();
if (iterations > 1 && f != nullptr) {
- std::cerr << "rbd: specifing iterations is not valid with formatted output"
+ std::cerr << "rbd: specifying iterations is not valid with formatted output"
<< std::endl;
return -EINVAL;
}
for (auto &name : mirroring_namespaces) {
auto it = m_namespace_replayers.find(name);
if (it == m_namespace_replayers.end()) {
- // acuire leader for this namespace replayer failed
+ // acquire leader for this namespace replayer failed
continue;
}
it->second->handle_instances_added(instance_ids);
dout(10) << "r=" << r << dendl;
if (r == -EOPNOTSUPP) {
- // older OSD that doesn't support snaphot-based mirroring, so no need
+ // older OSD that doesn't support snapshot-based mirroring, so no need
// to query remote peers
dout(10) << "remote peer does not support snapshot-based mirroring"
<< dendl;
notify_listener();
return;
} else if (r < 0) {
- // we can still see if we can perform a peer list and find outselves
+ // we can still see if we can perform a peer list and find ourselves
derr << "failed to ping remote mirror peer: " << cpp_strerror(r) << dendl;
}
std::unique_lock locker{m_lock};
if (r < 0) {
- derr << "error closing local iamge: " << cpp_strerror(r) << dendl;
+ derr << "error closing local image: " << cpp_strerror(r) << dendl;
handle_replay_error(r, "failed to close local image");
}
ceph rbd recover tool is just used for this, it can collect all objects of an image from distributed
osd nodes with the latest pg epoch, and splice objects by offset to a complete image. To make sure
object data is complete, this tool does flush osd journal on each osd node before recovering.
- but, there are some limitions:
+ but, there are some limitations:
-need ssh service and unobstructed network
-osd data must be accessed on local disk
-clone image is not supported, while snapshot is supported
--only support relicated pool
+-only support replicated pool
before you run this tool, you should make sure that:
1). all processes (ceph-osd, ceph-mon, ceph-mds) are shutdown
-usage:
-rbd-recovert-tool <operation>
+rbd-recover-tool <operation>
<operation> :
database #generating offline database: hobject path, node hostname, pg_epoch and image metadata
list #list all images from offline database
exit
fi
lines=$(($lines + 1))
- # in case : there are servral hostnames on the same node
+ # in case : there are several hostnames on the same node
# just need output of `hostname`
local hostname_alias=
hostname_alias=`ssh $ssh_option $node "hostname" 2>/dev/null </dev/null`
# rbd-recover-tool is an offline recover tool for rbd image in replicated pool
# when ceph cluster is stopped.
-# it is a simple disater recovery policy, just for urgent condition
+# it is a simple disaster recovery policy, just for urgent condition
my_dir=$(dirname "$0")
echo "$cmd_name database
gather pg info, object info, image metadata,
and epoch info from all osd nodes,
- this will cosume a long time, just be patient,
+ this will consume a long time, just be patient,
especially when scale up to 1000+ osds"
echo "$cmd_name list
list all rbd images of all replicated pools,
echo "$cmd_name lookup <pool_id>/<image_name>[@[<snap_name>]]
show image metadata: image format, rbd id, size, order, snapseq
In addition, for image with snapshots,
- this will list all snapshot infomations"
+ this will list all snapshot information"
echo "$cmd_name recover <pool_id>/<image_name>[@[<snap_name>]] [</path/to/store/image>]
all snapshots share one image head, to economize disk space
so there is only one snapshot at any time,
case WAIT_OBJECT_0:
if (!GetOverlappedResult(pipe_handle, &connect_o, &bytes_read, TRUE)) {
err = GetLastError();
- derr << "Couln't establish a connection with the child process. "
+ derr << "Couldn't establish a connection with the child process. "
<< "Error: " << win32_strerror(err) << dendl;
exit_code = -ECHILD;
goto clean_process;
--soft-disconnect-timeout Soft disconnect timeout in seconds. The soft
disconnect operation uses PnP to notify the
Windows storage stack that the device is going to
- be disconnectd. Storage drivers can block this
+ be disconnected. Storage drivers can block this
operation if there are pending operations,
unflushed caches or open handles. Default: 15
Service options:
--hard-disconnect Skip attempting a soft disconnect
- --soft-disconnect-timeout Cummulative soft disconnect timeout in seconds,
+ --soft-disconnect-timeout Cumulative soft disconnect timeout in seconds,
used when disconnecting existing mappings. A hard
disconnect will be issued when hitting the timeout
--service-thread-count The number of workers used when mapping or