cockroachdb / cockroachdb/cockroach

sql/rowexec: SetResumeSpansAndSSTManifestsInJob silently drops SST manifests

Open
#166,621 1 comment 0 reactions 0 assignees View on GitHub
branch-master C-bug O-agent T-testeng
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

## Summary

`SetResumeSpansAndSSTManifestsInJob` in `pkg/sql/rowexec/columnbackfiller.go` accepts `manifests []jobspb.BulkSSTManifest` and `codec *keys.SQLCodec` parameters but uses neither. SST manifests passed by the legacy schema changer's distributed-merge index backfill path are silently dropped, preventing checkpoint recovery of manifest data on crash.

## Impact

When `bulkio.index_backfill.distributed_merge.mode` is set to `legacy` or `enabled`, a process crash during or after the map phase loses all manifest data. The backfill must redo the entire map phase. The default setting is `disabled`, so this does not affect default deployments.

## Root Cause

The `ResumeSpanList` proto message (`pkg/jobs/jobspb/jobs.proto:991-994`) has field 2 **reserved** — the manifests field was removed from the proto. The function signature was updated to accept manifests but the body was never updated to persist them.

## Suggested Fix

Option A: Persist manifests to job info keys, mirroring the declarative schema changer pattern.
Option B: Remove the `manifests` and `codec` parameters and have callers persist manifests separately.

_This issue was found via automated deep static analysis._

Jira issue: CRDB-62033

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.