-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support wal covered writing #92
Conversation
edebdd3
to
a2273ab
Compare
4be12d7
to
d3228ef
Compare
66964ff
to
3fe5496
Compare
curve-ansible/deploy_chunkserver.yml
Outdated
@@ -0,0 +1,17 @@ | |||
|
|||
- name: prepare chunkserver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥在这里有一个单独的deploy_chunkserver.yml? 之前不是直接放在deploy_curve.yml里的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
自己写的临时程序忘删了,已删掉
- name: copy files to tempory directory | ||
become: false | ||
copy: src={{ local_file_path }} dest={{ tmp_dir }} mode={{ file_mode }} | ||
- name: mv file | ||
shell: sudo cp -rf {{ tmp_dir }}/* {{ remote_dir_name }} | ||
when: copy_file_res.failed | ||
when: copy_file_res.failedss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
笔误?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
echo " -chunkfilepool_dir=/data/chunkserver{id}/chunkfilepool/" | ||
echo " -chunkfilepool_metapath==/data/chunkserver{id}/chunkfilepool.meta" | ||
echo " deploy all wal pool : ./chunkserver_ctl.sh deploy-wal-pool all" | ||
echo " deploy one wal pool : ./chunkserver_ctl.sh deploy-wal-pool {\$chunkserverId}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有deploy all chunkfile pool 和 deploy one chunkfilepool吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前没有场景需要提供单独的格式化chunfile pool的命令
src/chunkserver/chunk_closure.h
Outdated
@@ -46,6 +46,7 @@ class ChunkClosure : public braft::Closure { | |||
~ChunkClosure() = default; | |||
|
|||
void Run() override; | |||
butil::Timer timer; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加在下面成员变量中
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是用来计算metric的,不再需要,已去掉
walfilepool.meta_path=./0/walfilepool.meta | ||
walfilepool.segment_size=8388608 | ||
walfilepool.metapage_size=4096 | ||
walfilepool.meta_file_size=4096 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta_file_size 和 metapage_size 有啥区别
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta_file_size是记录元数据文件的大小,元数据文件是格式化之后存放pool的目录,file_size,meta_size这些元数据的。
metapage_size是头部的meta page的大小,也是内存对齐的单位
src/chunkserver/op_request.cpp
Outdated
@@ -35,6 +35,9 @@ | |||
#include "src/chunkserver/clone_manager.h" | |||
#include "src/chunkserver/clone_task.h" | |||
|
|||
static bvar::LatencyRecorder g_oprequest_writechunk_latency( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
临时的metric先去掉吧,后面统一添加,需要有开关
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return _from_pool; | ||
} | ||
private: | ||
friend class butil::RefCountedThreadSafe<CurveSegment>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不对齐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/fs/ext4_filesystem_impl.cpp
Outdated
|
||
#include "src/common/string_util.h" | ||
#include "src/fs/ext4_filesystem_impl.h" | ||
#include "src/fs/wrap_posix.h" | ||
|
||
#define MIN_KERNEL_VERSION KERNEL_VERSION(3, 15, 0) | ||
static bvar::LatencyRecorder g_fs_write_latency( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
临时的metric先去掉吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
9b3fec6
to
53b124e
Compare
288d697
to
3ae488e
Compare
do { | ||
if (dynamic_cast<BraftSegment *>(_open_segment.get()) != nullptr) { | ||
LOG(INFO) << "Loaded a braft open segment, close it directly"; | ||
scoped_refptr<Segment> prev_open_segment; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥要使用scoped_refptr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
braft::segment是用scoped_refptr管理的,把析构函数定义成了私有的,只有scope ptr能够访问
if (first_index == last_index + 1) { | ||
return -1; | ||
} | ||
if (index < first_index || index > last_index + 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥不是index > last_index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是为了把index=last_index+1单独处理,不打日志。replicator复制日志的时候会逐渐增加index去get_entry,直到即将发送的entry数量超过最大值或者get_entry返回失败。所以index=last_index+1是每次循环结束的条件,不用打日志。
<< " first_log_index: " << first_index | ||
<< " last_log_index: " << last_index; | ||
return -1; | ||
} else if (index == last_index + 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么这个要放在这里单独判断
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
What is changed and how it works?
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List