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

Allow to flush data from writecache #1806

Merged
merged 8 commits into from
Sep 28, 2022
Merged

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Sep 21, 2022

No description provided.

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #1806 (6e7c1b4) into master (93742d3) will increase coverage by 0.04%.
The diff coverage is 15.66%.

❗ Current head 6e7c1b4 differs from pull request most recent head e5e08ef. Consider uploading reports for the commit e5e08ef to get more accurate results

@@            Coverage Diff             @@
##           master    #1806      +/-   ##
==========================================
+ Coverage   30.95%   31.00%   +0.04%     
==========================================
  Files         372      374       +2     
  Lines       25880    26175     +295     
==========================================
+ Hits         8012     8116     +104     
- Misses      17193    17377     +184     
- Partials      675      682       +7     
Impacted Files Coverage Δ
pkg/local_object_storage/engine/writecache.go 0.00% <0.00%> (ø)
pkg/local_object_storage/shard/mode.go 100.00% <ø> (+8.00%) ⬆️
pkg/local_object_storage/shard/writecache.go 0.00% <0.00%> (ø)
pkg/local_object_storage/writecache/options.go 57.14% <ø> (+28.57%) ⬆️
pkg/local_object_storage/writecache/writecache.go 77.08% <ø> (ø)
pkg/services/control/convert.go 0.00% <0.00%> (ø)
pkg/services/control/ir/service.pb.go 22.42% <ø> (ø)
pkg/services/control/ir/service_grpc.pb.go 0.00% <ø> (ø)
pkg/services/control/ir/types.pb.go 35.00% <ø> (ø)
pkg/services/control/rpc.go 0.00% <0.00%> (ø)
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last commit msg is not capitalized.

// Flush flushes all objects from the write-cache to the main storage.
// Write-cache must be in readonly mode to ensure correctness of an operation and
// to prevent interference with background flush workers.
func (c *cache) Flush() error {
Copy link
Member

@carpawell carpawell Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need any IgnoreErrors like we have in the similar commands?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

return ErrWriteCacheDisabled
}

s.m.Lock()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is RLock enough here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed

cthulhu-rider
cthulhu-rider previously approved these changes Sep 23, 2022

// ErrWriteCacheDisabled is returned when an operation on write-cache is performed,
// but write-cache is disabled.
var ErrWriteCacheDisabled = errors.New("write-cache is disabled")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave it unexported? I don't see where else we use it. Same for ErrMustBeReadOnly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

carpawell
carpawell previously approved these changes Sep 26, 2022
@fyrchik
Copy link
Contributor Author

fyrchik commented Sep 26, 2022

@carpawell Only updated changelog

carpawell
carpawell previously approved these changes Sep 26, 2022
Allow to provide it using config file.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Allow user to initiate flushing objects from a writecache.
We need this in 2 cases:
1. During writecache storage schema update, it should be flushed with
   the old version of node and started clean with a new one.
2. During SSD replacement, to avoid data loss.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
@fyrchik
Copy link
Contributor Author

fyrchik commented Sep 27, 2022

Rebased on master

@fyrchik fyrchik merged commit 0a41190 into nspcc-dev:master Sep 28, 2022
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Allow user to initiate flushing objects from a writecache.
We need this in 2 cases:
1. During writecache storage schema update, it should be flushed with
   the old version of node and started clean with a new one.
2. During SSD replacement, to avoid data loss.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
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