没有合适的资源?快使用搜索试试~ 我知道了~
临时meta同步数据,未完成
需积分: 10 1 下载量 122 浏览量
2020-09-25
20:37:19
上传
评论
收藏 5KB TXT 举报
温馨提示
试读
6页
rgw meta同步,临时保存在这里,便于以后查询 、 rgw meta同步,临时保存在这里,便于以后查询 rgw meta同步,临时保存在这里,便于以后查询
资源推荐
资源详情
资源评论
// 同步 run_sync_thread
auto async_processor = svc.rados->get_async_processor();
std::lock_guard l{meta_sync_thread_lock};
meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this->store, async_processor);
ret = meta_sync_processor_thread->init();
meta_sync_processor_thread->start();
// configure the bucket trim manager
rgw::BucketTrimConfig config;
rgw::configure_bucket_trim(cct, config);
bucket_trim.emplace(this->store, config);
ret = bucket_trim->init();
svc.datalog_rados->set_observer(&*bucket_trim);
std::lock_guard dl{data_sync_thread_lock};
for (auto source_zone : svc.zone->get_data_sync_source_zones()) {
ldout(cct, 5) << "starting data sync thread for zone " << source_zone->name << dendl;
auto *thread = new RGWDataSyncProcessorThread(this->store, svc.rados->get_async_processor(), source_zone);
ret = thread->init();
thread->start();
data_sync_processor_threads[rgw_zone_id(source_zone->id)] = thread;
}
auto interval = cct->_conf->rgw_sync_log_trim_interval;
if (interval > 0) {
sync_log_trimmer = new RGWSyncLogTrimThread(this->store, &*bucket_trim, interval);
ret = sync_log_trimmer->init();
sync_log_trimmer->start();
}
auto async_processor = svc.rados->get_async_processor();
std::lock_guard l{meta_sync_thread_lock};
meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this->store, async_processor);
ret = meta_sync_processor_thread->init();
meta_sync_processor_thread->start();
// configure the bucket trim manager
rgw::BucketTrimConfig config;
rgw::configure_bucket_trim(cct, config);
bucket_trim.emplace(this->store, config);
ret = bucket_trim->init();
svc.datalog_rados->set_observer(&*bucket_trim);
std::lock_guard dl{data_sync_thread_lock};
for (auto source_zone : svc.zone->get_data_sync_source_zones()) {
ldout(cct, 5) << "starting data sync thread for zone " << source_zone->name << dendl;
auto *thread = new RGWDataSyncProcessorThread(this->store, svc.rados->get_async_processor(), source_zone);
ret = thread->init();
thread->start();
data_sync_processor_threads[rgw_zone_id(source_zone->id)] = thread;
}
auto interval = cct->_conf->rgw_sync_log_trim_interval;
if (interval > 0) {
sync_log_trimmer = new RGWSyncLogTrimThread(this->store, &*bucket_trim, interval);
ret = sync_log_trimmer->init();
sync_log_trimmer->start();
}
//构造过程
RGWMetaSyncProcessorThread(this->store, async_processor);
sync(_store, async_rados)
master_log(this, store, async_rados, this)
// 初始化 RGWMetaSyncProcessorThread
int RGWMetaSyncStatusManager::init() {
// ioctx 成员变量,打开log_pool
int r = rgw_init_ioctx(store->getRados()->get_rados_handle(), store->svc()->zone->get_zone_params().log_pool, ioctx, true);
// RGWRemoteMetaLog master_log; master_log(this, store, async_rados, this) this=RGWMetaSyncStatusManager
r = master_log.init(); // RGWRemoteMetaLog::init
RGWMetaSyncEnv& sync_env = master_log.get_sync_env();
rgw_meta_sync_status sync_status;
// 从 "mdlog.sync-status" 读取同步状态
// 从 "mdlog.sync-status.shard.<shardId>" 中读取同步marker,既是同步的位置
r = read_sync_status(&sync_status);
int num_shards = sync_status.sync_info.num_shards; // 8
for (int i = 0; i < num_shards; i++) {
shard_objs[i] = rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, sync_env.shard_obj_name(i));
}
}
// 启动 线程开始执行
RGWRemoteMetaLog::run_sync
rgw_mdlog_info mdlog_info;
// 获取master_zone的 rgw_md_log_max_shards 以及 period信息, master_zone的处理函数: RGWOp_MDLog_Info::execute
剩余5页未读,继续阅读
资源评论
布衣小弟
- 粉丝: 14
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功