Skip to content
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(slog): flush and remove all shared logs for garbage collection #1594

Merged
merged 28 commits into from
Sep 21, 2023

Conversation

empiredan
Copy link
Contributor

@empiredan empiredan commented Aug 31, 2023

#1593

In XiaoMi/rdsn#1019 we've written private logs as
WAL instead of shared logs, which also means shared log files would never
be appended with new mutations.

However, obsolete shared logs that had been applied to rocksdb were not
removed since then. There is at least 1 shared log file which is never removed.
We should change this policy of garbage collection, to delete all obsolete
shared log files.

To facilitate the garbage collection of shared log files, we also trigger checkpoints
which would flush rocksdb data to disk for each replica that has prevented shared
log files from being removed for garbage collection. It is necessary to limit the
number of submitted replicas that would be flushed at a time to avoid too much
consumption of I/O resources which might affect the processing of read/write
requests from clients.

@empiredan empiredan marked this pull request as draft August 31, 2023 07:53
@github-actions github-actions bot added the cpp label Aug 31, 2023
@empiredan empiredan changed the title feat(slog): apply and remove shared logs feat(slog): flush and remove all shared logs for garbage collection Sep 12, 2023
@empiredan empiredan marked this pull request as ready for review September 12, 2023 13:02
src/replica/replica_stub.h Show resolved Hide resolved
src/replica/replica_stub.h Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/mutation_log.h Outdated Show resolved Hide resolved
src/replica/replica_stub.h Show resolved Hide resolved
src/replica/replica_stub.h Show resolved Hide resolved
src/replica/replica_stub.h Outdated Show resolved Hide resolved
@empiredan empiredan merged commit c8793d2 into apache:master Sep 21, 2023
75 checks passed
empiredan added a commit to empiredan/pegasus that referenced this pull request Oct 16, 2023
…pache#1594)

apache#1593

In XiaoMi/rdsn#1019 we've written private logs as
WAL instead of shared logs, which also means shared log files would never
be appended with new mutations.

However, obsolete shared logs that had been applied to rocksdb were not
removed since then. There is at least 1 shared log file which is never removed.
We should change this policy of garbage collection, to delete all obsolete
shared log files.

To facilitate the garbage collection of shared log files, we also trigger checkpoints
which would flush rocksdb data to disk for each replica that has prevented shared
log files from being removed for garbage collection. It is necessary to limit the
number of submitted replicas that would be flushed at a time to avoid too much
consumption of I/O resources which might affect the processing of read/write
requests from clients.
empiredan added a commit to empiredan/pegasus that referenced this pull request Oct 19, 2023
…pache#1594)

apache#1593

In XiaoMi/rdsn#1019 we've written private logs as
WAL instead of shared logs, which also means shared log files would never
be appended with new mutations.

However, obsolete shared logs that had been applied to rocksdb were not
removed since then. There is at least 1 shared log file which is never removed.
We should change this policy of garbage collection, to delete all obsolete
shared log files.

To facilitate the garbage collection of shared log files, we also trigger checkpoints
which would flush rocksdb data to disk for each replica that has prevented shared
log files from being removed for garbage collection. It is necessary to limit the
number of submitted replicas that would be flushed at a time to avoid too much
consumption of I/O resources which might affect the processing of read/write
requests from clients.
acelyc111 pushed a commit that referenced this pull request Oct 19, 2023
…1594) (#1638)

#1593

In XiaoMi/rdsn#1019 we've written private logs as
WAL instead of shared logs, which also means shared log files would never
be appended with new mutations.

However, obsolete shared logs that had been applied to rocksdb were not
removed since then. There is at least 1 shared log file which is never removed.
We should change this policy of garbage collection, to delete all obsolete
shared log files.

To facilitate the garbage collection of shared log files, we also trigger checkpoints
which would flush rocksdb data to disk for each replica that has prevented shared
log files from being removed for garbage collection. It is necessary to limit the
number of submitted replicas that would be flushed at a time to avoid too much
consumption of I/O resources which might affect the processing of read/write
requests from clients.

This PR is to cherry-pick #1594 into v2.5 to solve issue #1593.
@empiredan empiredan mentioned this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants