tkhurana opened a new pull request, #2627: URL: https://github.com/apache/phoenix/pull/2627
Replace the scattered per-batch re-derivation of a batch's HA disposition with a single BatchOrigin classification, gate all HA write-path semantics on the SYNCHRONOUS_REPLICATION_ENABLED master switch, and add replication-log commit-id observability. - BatchOrigin (CLIENT_HA, CLIENT_NON_HA, PHX_REPLAY, NATIVE_IN): classified once per batch and carried on BatchMutateContext as the single source of truth; isReplay() is derived from it (no separate flag). - Split shouldReplicate into syncReplicationEnabled (master switch) and replicateTable (switch AND per-table eligibility). Gate the cluster-role mutation-block / staleness check on the master switch so it never runs, or resolves a not-yet-created HA group, while the feature is off -- makes the rollout window safe. - bypassedMutationBlockCount increments only for CLIENT_NON_HA (replay and native-replicated-in excluded). getReplicationLogGroup owns the full "which writer" decision; isReplicatedBatch reduces to log-group presence, with a checkState enforcing present => CLIENT_HA. - Replication-log observability: carry the WAL seq id as each record's commitId; advance lastCommitId through a single appendRecord() path (normal and post-failover replay) and log it at mode switches; log recordsRead on standby replay; drop the batchSize histogram. - Correct the operator-facing bypassedMutationBlockCount JMX/javadoc to the CLIENT_NON_HA-on-eligible-table definition. Tests: BatchOrigin unit cases incl. multi-mutation batch uniformity; SyncReplicationRolloutStep1IT (feature off, missing group -> write succeeds) and SyncReplicationRolloutFeatureOnMissingGroupIT (feature on, missing group -> write fails closed); replay batch does not increment the bypass counter; ReplicationLogGroupParallelIT (non-active PARALLEL double-write commits without a split-brain throw). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
