Skip to content

[Bug]: main cannot reopen a READY 4.0.7 catalog at offset 44 after the Python UDF migration #33548

Not planned

Description

@XuPeng-SH

Impact

A normal shutdown and binary replacement from a recent main development snapshot prevents the CN from starting. The existing catalog is READY at 4.0.7/44. The new binary declares 4.0.7/53 and rejects the offset change. Users can hit this even when they have never created a Python UDF.

Reproduction

  1. Start a fresh single-CN cluster from 32c9bc6527f8b2c1f7b66e92a548137679085da5. In an isolated data directory, run:
CREATE DATABASE qa_persist;
USE qa_persist;
CREATE TABLE p (id INT PRIMARY KEY, payload VARCHAR(1200));
INSERT INTO p
SELECT result, REPEAT('b',result%1024) FROM GENERATE_SERIES(1,24000) g;
SELECT mo_ctl('dn','flush','qa_persist.p');
DELETE FROM p WHERE id%3=1;
UPDATE p SET payload=CONCAT(payload,'x') WHERE id%11=0;
SELECT mo_ctl('dn','flush','qa_persist.p');
SELECT COUNT(*), SUM(id), SUM(LENGTH(payload)) FROM p;
-- 16000, 192016000, 8099886
  1. Gracefully stop the cluster. Reopen the original data with the same old binary, service addresses and configuration, and verify the aggregates.
  2. Gracefully stop again and start 33485201662f48d2b318dc8c73729d3dc9e5edc0 with the same data and service configuration.

This is a reduced data setup. The executed QA fixture also used ordinary ENUM/SET columns and a composite UNIQUE index. Two separately initialized data directories failed when reopened with the new binary. The second run included the old-binary restart and aggregate checks. A fresh cluster on the new binary started normally.

Actual result

invalid state catalog 4.0.7 offset 44 differs from binary offset 53; 4.0.7 is frozen and further migrations require a new catalog version

#29152 added nine entries under the existing v4_0_7 handler. The startup check rejects a READY offset mismatch before the new entries can run.

Expected result

Provide a supported transition from READY 4.0.7/44 that preserves the old user data, runs the new catalog entries, and completes on retry or restart. Verify an old catalog with and without existing routines. The reproduced scope is development snapshots on main. Released-to-current upgrade paths require separate testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions