[
https://issues.apache.org/jira/browse/PHOENIX-7906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lokesh Khurana reassigned PHOENIX-7906:
---------------------------------------
Assignee: Lokesh Khurana
> TransformType backward-compat via UNKNOWN sentinel
> --------------------------------------------------
>
> Key: PHOENIX-7906
> URL: https://issues.apache.org/jira/browse/PHOENIX-7906
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Lokesh Khurana
> Assignee: Lokesh Khurana
> Priority: Major
>
> {{TransformType.fromValue(byte)}} today throws {{IllegalArgumentException}}
> on unrecognized bytes. Adding new TransformType values (e.g., Phase 1's
> {{{}PHYSICAL_RENAME_ONLY((byte) 3){}}}) breaks rolling upgrades — an old
> server reading a row written by a new client crashes on the byte.
> *Decision:* Option β — UNKNOWN sentinel. {{fromValue(byte)}} returns
> {{TransformType.UNKNOWN}} for unrecognized values; consuming sites handle
> UNKNOWN defensively.
>
> *Implementation:*
> * Add {{UNKNOWN((byte) -1)}} enum value (or similar sentinel byte).
> * {{fromValue(byte)}} returns UNKNOWN instead of throwing on unrecognized
> values.
> * UNKNOWN handling at four callsites:
> ** {{Transform.doCutover}} — log + skip + WARN
> ** {{TransformMonitorTask.run}} — skip the row, don't poll
> ** {{TransformClient.checkIsTransformNeeded}} — block new ALTER defensively
> (an UNKNOWN active row is treated as an active transform we don't understand)
> *
> ** {{TransformTool}} config-from-record — fail-fast with operator-readable
> message
>
> *Acceptance criteria:*
> * New server reading old client's row (with unknown TransformType byte) does
> not crash; sees UNKNOWN and applies the appropriate per-callsite handling.
> * Old server reading new client's row (similarly) does not crash.
> * UT for each of the 4 callsites' UNKNOWN handling.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)