Log cancelled Snapshot Store LockingSinks

This commit is contained in:
Philip O'Toole
2026-01-03 15:56:21 -05:00
committed by GitHub
parent 26645dc3d2
commit 27ced50741
2 changed files with 6 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
### Implementation changes and bug fixes
- [PR #2419](https://github.com/rqlite/rqlite/pull/2419): Improve MSRW Error structure.
- [PR #2420](https://github.com/rqlite/rqlite/pull/2420): Snapshot Sink sets owner when taking MSRW.
- [PR #2421](https://github.com/rqlite/rqlite/pull/2421): Log cancelled Snapshot Store LockingSinks.
## v9.3.7 (January 2nd 2026)
### Implementation changes and bug fixes

View File

@@ -64,6 +64,7 @@ type LockingSink struct {
mu sync.Mutex
closed bool
logger *log.Logger
}
// NewLockingSink returns a new LockingSink.
@@ -71,6 +72,7 @@ func NewLockingSink(sink raft.SnapshotSink, str *Store) *LockingSink {
return &LockingSink{
SnapshotSink: sink,
str: str,
logger: log.New(os.Stderr, "[snapshot-locking-sink] ", log.LstdFlags),
}
}
@@ -88,6 +90,9 @@ func (s *LockingSink) Close() error {
// Cancel cancels the sink, unlocking the Store for creation of a new sink.
func (s *LockingSink) Cancel() error {
defer func() {
s.logger.Printf("sink %s canceled", s.ID())
}()
s.mu.Lock()
defer s.mu.Unlock()
if s.closed {