Skip to content

Fix: pg_task / pg_task_run_history column reorder with catversion bump#1817

Open
roseduan wants to merge 1 commit into
apache:mainfrom
roseduan:fix/pg-task-catalog-version-bump
Open

Fix: pg_task / pg_task_run_history column reorder with catversion bump#1817
roseduan wants to merge 1 commit into
apache:mainfrom
roseduan:fix/pg-task-catalog-version-bump

Conversation

@roseduan

Copy link
Copy Markdown
Contributor

Some non-varlen fields (int32 nodeport, bool active in pg_task; timestamptz start_time / end_time in pg_task_run_history) were declared after CATALOG_VARLEN, which trips LLVM bitcode emission during JIT compilation.

Move them ahead of the varlen block. Because this rearranges the on-disk pg_attribute layout, bump CATALOG_VERSION_NO so an upgraded binary refuses to start against a pre-reorder cluster instead of crashing at runtime with SIGSEGV in heap_form_tuple on the first CREATE TASK.

Adjust ruleutils.c pg_get_dynamic_table_schedule() to fetch the schedule via heap_getattr() since &task->schedule on the Form struct is no longer valid for varlen-section fields.

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


Some non-varlen fields (int32 nodeport, bool active in pg_task;
timestamptz start_time / end_time in pg_task_run_history) were
declared after CATALOG_VARLEN, which trips LLVM bitcode emission
during JIT compilation.

Move them ahead of the varlen block. Because this rearranges the
on-disk pg_attribute layout, bump CATALOG_VERSION_NO so an upgraded
binary refuses to start against a pre-reorder cluster instead of
crashing at runtime with SIGSEGV in heap_form_tuple on the first
CREATE TASK.

Adjust ruleutils.c pg_get_dynamic_table_schedule() to fetch the
schedule via heap_getattr() since &task->schedule on the Form
struct is no longer valid for varlen-section fields.
@roseduan roseduan force-pushed the fix/pg-task-catalog-version-bump branch from b09ca97 to 38d28f2 Compare June 12, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant