Skip to content

ttl_expire has no pytest twin, and it is the suite for the one function that deletes rows #1188

Description

@jdatcmd

test/ttl_expire.sh has no pytest counterpart, so the pair does not exist and appears in neither COMPLETE nor INCOMPLETE in test_compare_to_bash.py.

Why this is a gap rather than a choice

The twin rule exists because the two harnesses fail differently. ttl_expire is the suite for pgcolumnar.expire, which deletes rows, and it is the one place in the tree where a wrong answer destroys data rather than reporting a wrong number. It is a poor candidate for single-harness coverage.

It was noticed while fixing #1135 (a date retention column). That change added arms to the shell suite only, deliberately and with the reason stated in the PR: a partial test_ttl_expire.py would manufacture a pair that cannot reach zero MISSING against a 43-check shell suite, landing it in INCOMPLETE -- a declared gap about the port, filed inside a change about a date type. #1183 had just emptied INCOMPLETE, and reopening it for an unrelated reason is worse than the gap it would record.

What the port owes

ttl_expire.sh is 43 checks at 3363331. The port must assert every one of those names for the pair to enter COMPLETE, which is the standing arm's rule.

The properties, in the order the shell suite establishes them:

  1. A group whose rows are all past the retention is retired.
  2. A group that straddles the cutoff survives with every row. This is the one that matters: dropping it is data loss, and a suite that only proved expired data disappears would pass on an implementation that dropped everything.
  3. A group holding NULL retention values is not retired, because the zone map's maximum covers only non-NULL values.
  4. An all-visible group is retired correctly, because expire bypasses the delete vector and the visibility-map bits VACUUM set stay on.
  5. A table with no declared retention raises an error rather than reporting that it did nothing.
  6. A second run retires nothing.
  7. The date column arms from opt: pgcolumnar.expire refuses a date retention column, though date is handled everywhere else #1135, including the rounding: a row dated exactly on the cutoff is kept.

What to watch when porting

Done when

ttl_expire is in COMPLETE with zero MISSING, and INCOMPLETE is still {}.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XiFn3HteTXnGdRiA2xDP2n

Activity

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