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(storagenode): restore the status of a log stream replica by using the latest commit context #170

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

ijsong
Copy link
Member

@ijsong ijsong commented Oct 5, 2022

What this PR does

This patch changes how to restore the status of a log stream replica after
#162. Previously, the log stream replica reads a sequence of all commit
contexts to decide whether it can work well after restoring. However, since the
replica will maintain only the latest commit context, we should change the
previous approach to reloading a replica.

The log stream replica reads the latest commit context and boundary of log
entries and checks if it recovers its status. The replica runs if the recovery
completes. However, if there is something wrong, its reportCommitBase will be
invalid. In that case, the metadata repository will ignore its report, and
cloning the log entries from the other replica will occur.

Which issue(s) this PR resolves

Updates #125

Anything else

@ijsong ijsong requested a review from hungryjang as a code owner October 5, 2022 07:18
@ijsong ijsong self-assigned this Oct 5, 2022
@codecov-commenter
Copy link

Codecov Report

Base: 63.05% // Head: 62.87% // Decreases project coverage by -0.18% ⚠️

Coverage data is based on head (d869711) compared to base (afa6fa4).
Patch coverage: 60.37% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
- Coverage   63.05%   62.87%   -0.19%     
==========================================
  Files         126      126              
  Lines       17137    17156      +19     
==========================================
- Hits        10806    10787      -19     
- Misses       5773     5814      +41     
+ Partials      558      555       -3     
Impacted Files Coverage Δ
internal/storage/config.go 66.35% <0.00%> (-2.58%) ⬇️
internal/storage/testing.go 25.80% <0.00%> (-74.20%) ⬇️
internal/storagenode/logstream/committer.go 79.18% <23.07%> (-2.67%) ⬇️
internal/storage/recovery_points.go 95.91% <77.77%> (-4.09%) ⬇️
internal/storage/storage.go 88.03% <83.33%> (+5.32%) ⬆️
internal/storagenode/logstream/executor.go 79.79% <100.00%> (+0.46%) ⬆️
...ternal/storagenode/logstream/log_stream_context.go 100.00% <100.00%> (ø)
internal/storagenode/replication_server.go 77.00% <0.00%> (-6.00%) ⬇️
internal/metarepos/report_collector.go 77.85% <0.00%> (-0.27%) ⬇️
internal/metarepos/raft_metadata_repository.go 71.71% <0.00%> (-0.27%) ⬇️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

…g the latest commit context

This patch changes how to restore the status of a log stream replica after kakao#162. Previously, the log
stream replica reads a sequence of all commit contexts to decide whether it can work well after
restoring. However, since the replica will maintain only the latest commit context, we should change
the previous approach to reloading a replica.

The log stream replica reads the last commit context and boundary of log entries and checks if it
recovers its status. The replica runs if the recovery completes. However, if there is something
wrong, its reportCommitBase will be invalid. In that case, the metadata repository will ignore its
report, and cloning the log entries from the other replica will occur.

Updates kakao#125
@ijsong ijsong force-pushed the fix-reload-logstream branch from d869711 to 9e042d2 Compare October 6, 2022 05:51
@ijsong ijsong requested a review from hungryjang October 6, 2022 06:02
@ijsong ijsong merged commit 3326588 into kakao:main Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants