lib/logstorage: Set ptwHot to nil when the partition pointed by ptwHot is dropped (#4902)

This commit is contained in:
crossoverJie 2023-08-29 17:01:19 +08:00 committed by Aliaksandr Valialkin
parent c81e90223c
commit 64b27c9217
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -366,6 +366,7 @@ func (s *Storage) MustClose() {
}
}
s.partitions = nil
s.ptwHot = nil
// Save caches
streamIDCachePath := filepath.Join(s.path, cacheDirname, streamIDCacheFilename)
@ -398,7 +399,7 @@ func (s *Storage) MustAddRows(lr *LogRows) {
}
s.partitionsLock.Unlock()
if ptwHot != nil && ptwHot.pt != nil {
if ptwHot != nil {
if ptwHot.canAddAllRows(lr) {
ptwHot.pt.mustAddRows(lr)
ptwHot.decRef()