-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: flush oldest cf #275
Merged
AlexStocks
merged 11 commits into
OpenAtomFoundation:import-braft
from
dingxiaoshuai123:flush_event
Apr 29, 2024
Merged
feat: flush oldest cf #275
AlexStocks
merged 11 commits into
OpenAtomFoundation:import-braft
from
dingxiaoshuai123:flush_event
Apr 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
longfar-ncy
reviewed
Apr 13, 2024
longfar-ncy
reviewed
Apr 13, 2024
longfar-ncy
reviewed
Apr 13, 2024
longfar-ncy
reviewed
Apr 13, 2024
Closed
dingxiaoshuai123
force-pushed
the
flush_event
branch
2 times, most recently
from
April 17, 2024 02:52
452979a
to
b165273
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
from
April 17, 2024 03:53
b165273
to
5ba8ca2
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
5 times, most recently
from
April 23, 2024 12:17
7936b43
to
b9b35a4
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
from
April 23, 2024 12:53
b9b35a4
to
0972a7b
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
from
April 23, 2024 14:06
c1d6ea8
to
55dbbdb
Compare
AlexStocks
approved these changes
Apr 25, 2024
longfar-ncy
reviewed
Apr 25, 2024
dingxiaoshuai123
force-pushed
the
flush_event
branch
3 times, most recently
from
April 26, 2024 09:17
4e1a624
to
c7b38d4
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
from
April 28, 2024 03:02
c7b38d4
to
9a37cee
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
from
April 28, 2024 03:14
9a37cee
to
32a227e
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
2 times, most recently
from
April 28, 2024 10:30
1f56258
to
c8017d9
Compare
dingxiaoshuai123
force-pushed
the
flush_event
branch
from
April 28, 2024 12:23
c8017d9
to
26826fc
Compare
panlei-coder
approved these changes
Apr 29, 2024
longfar-ncy
reviewed
Apr 29, 2024
src/praft/praft.cc
Outdated
@@ -525,7 +525,7 @@ butil::Status PRaft::DoSnapshot(int64_t self_snapshot_index, bool is_sync) { | |||
// TODO(panlei) Increase the self_log_index parameter | |||
// TODO(panlei) Use the is_sync parameter to determine whether |
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.
这两个todo需要删吗?
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.
longfar-ncy
approved these changes
Apr 29, 2024
AlexStocks
reviewed
Apr 29, 2024
} | ||
|
||
public: | ||
static std::atomic_int64_t max_gap_; |
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.
没有初始值?
AlexStocks
approved these changes
Apr 29, 2024
dingxiaoshuai123
added a commit
to dingxiaoshuai123/pikiwidb
that referenced
this pull request
Apr 30, 2024
* Revert to using the version with independent atomic variables.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1, 使用 WriteBufferManager 控制一个 DB 内所有 RocksDB 的上限, 当超过上限之后, Flush 最老的 CF.
2, 定期检查队列长度, 当队列长度超过阈值, 手动 Flush 最旧 CF.
3, 根据 Flush 次数触发 do_snapshot 行为.
修改的地方:
1 在 flush listener 中同步 flush 会死锁, 具体的位置还没有找, 所以改为异步 flush.
2 更新 last_flush_index 的逻辑有问题, 导致一直是 0, 已更改.
3 记录 SequenceNumber 的逻辑有问题, 已更改.
4 对一个 flush 带来的连锁反应进行了模拟.