From 3b91e29264a4b1066267cb727c7d18b4b2ad111f Mon Sep 17 00:00:00 2001 From: hll1213181368 Date: Sun, 3 Aug 2025 22:41:17 +0800 Subject: [PATCH 1/2] Fix nil pointer when print MigratingSlot string function --- store/slot.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/store/slot.go b/store/slot.go index 448002eb..147c88f2 100644 --- a/store/slot.go +++ b/store/slot.go @@ -49,6 +49,13 @@ type MigratingSlot struct { IsMigrating bool } +func (migratingSlot *MigratingSlot) String() string { + if migratingSlot == nil { + return "" + } + return strconv.Itoa(migratingSlot.Start) + "-" + strconv.Itoa(migratingSlot.Stop) +} + func NewSlotRange(start, stop int) (SlotRange, error) { if start > stop { return SlotRange{}, errors.New("start was larger than stop") From 78344dcc83b9b2a1d76f4d28c600d949928fe93a Mon Sep 17 00:00:00 2001 From: hll1213181368 Date: Mon, 4 Aug 2025 11:38:57 +0800 Subject: [PATCH 2/2] Fix nil pointer when print MigratingSlot string function --- store/slot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/slot.go b/store/slot.go index 147c88f2..d44dd9c1 100644 --- a/store/slot.go +++ b/store/slot.go @@ -53,7 +53,7 @@ func (migratingSlot *MigratingSlot) String() string { if migratingSlot == nil { return "" } - return strconv.Itoa(migratingSlot.Start) + "-" + strconv.Itoa(migratingSlot.Stop) + return migratingSlot.SlotRange.String() } func NewSlotRange(start, stop int) (SlotRange, error) {