Skip to content

Commit 35d6de6

Browse files
committed
catalog/lease: fix a bug in out-of-band close timestamp logic
Previously, the logic for handling descriptor updates for the locked lease timestamps was incorrectly truncating the descriptor versions array. This could lead to a panic due to an out-of-bounds access later on, since the descriptor versions and descriptor IDs arrays should be the same size. To address this, this patch ensures the correct length is used. Fixes: #157880 Release note: None
1 parent dc14156 commit 35d6de6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sql/catalog/lease/lease.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,7 @@ func (m *Manager) processDescriptorUpdate(
21882188
}
21892189
// Remove one element from the end after.
21902190
entry.mu.DescriptorIDs = entry.mu.DescriptorIDs[:len(entry.mu.DescriptorIDs)-1]
2191-
entry.mu.DescriptorVersions = entry.mu.DescriptorVersions[:len(entry.mu.DescriptorIDs)-1]
2191+
entry.mu.DescriptorVersions = entry.mu.DescriptorVersions[:len(entry.mu.DescriptorVersions)-1]
21922192
break
21932193
}
21942194
return len(entry.mu.DescriptorIDs) == 0

0 commit comments

Comments
 (0)