fix(shardnode): check readIndexFunc loaded in shard when preRWCheck

with: #1000167662

Signed-off-by: xiejian <xiejian3@oppo.com>
This commit is contained in:
xiejian 2025-06-10 11:20:48 +08:00 committed by slasher
parent daf016636f
commit 413c1de3c2

View File

@ -1049,7 +1049,7 @@ func (s *shardState) splitStopWriting() {
}
func (s *shardState) prepRWCheck(ctx context.Context) error {
if atomic.LoadUint32(&s.restartLeaderReadIndex) == needReadIndex {
if atomic.LoadUint32(&s.restartLeaderReadIndex) == needReadIndex && s.readIndexFunc != nil {
if err := s.readIndexFunc(ctx); err != nil {
return err
}