Skip to content

Pre-2.1 ALTERed TEXT columns: mixed-row 'invalid hash length: 19' panics on 2.1.4; schema-encoding-drift check reports clean; rows not repairable via SQL #11205

Description

@marcodelpin

Follow-up from #11131 (comment) — filing as a separate issue as requested by @timsehn.

We hit what looks like a variant of #11131 in production-style usage, and the repair tool from the zachmu/schema-repair-tool branch does not detect it.

Setup

Symptom — same signature as #11131, on 2.1.4

Any read that forces a decode of an affected cell panics server-side and drops the connection:

Error 1105 (HY000): panic recovered: invalid hash length: 19
...
github.com/dolthub/dolt/go/store/hash.New
github.com/dolthub/dolt/go/store/val.AdaptiveValue.convertToTextStorage
	github.com/dolthub/dolt/go/store/val/adaptive_value.go:202
github.com/dolthub/dolt/go/store/val.(*TupleDesc).GetStringAdaptiveValue
	github.com/dolthub/dolt/go/store/val/tuple_descriptor.go:618
github.com/dolthub/dolt/go/libraries/doltcore/sqle/index.prollyRowIter.Next

(gms in the recovered stack: v0.20.1-0.20260605175459-433dbaebc97f)

How it differs from the original #11131 report

  1. Mixed tables. Only the rows that existed before the ALTER are unreadable (e.g. 133 of 436 rows in one table, clustered around the original data-import date). Rows written after the ALTER read fine — including recent rows with >2KB values, so this is not value-size-correlated. SELECT COUNT(*) is fine; SELECT COUNT(LENGTH(col)) panics; per-row probes isolate exactly which rows are bad.
  2. schema-encoding-drift check reports clean. We built the tool from zachmu/schema-repair-tool @ 709aad077e and ran it (read-only) against the live data dir of the affected databases: no schema-encoding drift detected on every one of them, including a database where the panic is 100% reproducible. So either the heterogeneous-bucket classification misses this shape, or the tool (its build reports dolt version 2.0.8) can't read schema records written/migrated by 2.1.x.
  3. No SQL-level self-service. UPDATE t SET col = NULL WHERE id = '<bad-row>' and DELETE FROM t WHERE id = '<bad-row>' both panic the same way (row materialization decodes the old value), so we can't even null-out or drop the affected rows from SQL.
  4. Scale: out of ~140 databases on the instance, 19 have an affected table of one shape, 5 of another, and 4 have it on their primary data table.

Questions

  1. Is the schema-repair-tool branch expected to detect/repair mixed-row tables on 2.1.x-written storage? If not, is there a recommended path for this variant?
  2. Given that the writer was 2.0.x-era ALTER (so presumably schema-tag drift with intact row bytes, as diagnosed in Dolt 2.0.8: adaptive out-of-line TEXT written via migration is unreadable — "invalid hash length: 19" on read (regression vs 2.0.4) #11131), would a 2.1.4-built recover-rows-style pass be the right tool, and is there a build of it that understands current storage?

We can share a scrubbed copy of an affected database directory privately, and we're on Discord if real-time is easier. For now we've patched our application to skip-and-warn on this signature during its own data migrations, so we're unblocked operationally — but the affected cells remain unreadable.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions