-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
Codecov Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. 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.
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 { |
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.
do we need any IgnoreErrors
like we have in the similar commands?
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.
Fixed
return ErrWriteCacheDisabled | ||
} | ||
|
||
s.m.Lock() |
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.
is RLock
enough here?
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.
Yes, fixed
|
||
// ErrWriteCacheDisabled is returned when an operation on write-cache is performed, | ||
// but write-cache is disabled. | ||
var ErrWriteCacheDisabled = errors.New("write-cache is disabled") |
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.
Can we leave it unexported? I don't see where else we use it. Same for ErrMustBeReadOnly
.
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.
Fixed
@carpawell Only updated changelog |
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>
Rebased on master |
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>
No description provided.