tkhurana opened a new pull request, #2671:
URL: https://github.com/apache/phoenix/pull/2671

   Each replicated batch registers a floor (the region's MVCC write point) in 
preWALAppend, before HBase assigns its sequence id, and releases it once the 
batch is replicated. The region's replicated watermark W is the oldest 
registered floor, and every WAL edit carries it as the _ReplWatermark WAL key 
attribute. A batch whose ship fails keeps its floor until the region closes, 
holding W below it.
   
   On WAL replay, preWALRestore buffers recovered HA edits, one HA group at a 
time, and drops those a later edit's W covers; it looks up no group per edit. 
The rest are drained: at the end of each recovered-edits file, for a file HBase 
moved aside, on an HA group change, at a batch cap 
(phoenix.replication.restore.sync.batch.edits/bytes), before any replayed edit 
(HA or not) that could trigger a mid-replay flush, and in postOpen. A drain 
resolves the group and checks it is usable, then re-ships the edits in one 
sync, or records them as DEMOTED_RESTORE when the cluster is not active (or was 
not when the open met the group). Any failure is recorded as RESTORE_FAILED and 
the region opens: no restore hook fails the open. Each file logs a summary of 
replayed, skipped, re-shipped and recorded edits; preWALRestoreTime times the 
drains. With replication off for the table the restore, open and close hooks do 
nothing.
   
   Recovered SYSTEM.CATALOG and SYSTEM.CHILD_LINK edits are filtered with the 
live path's ignoreReplicationFilter, so rows the live path never ships are not 
re-shipped.
   
   PhoenixRegionServerEndpoint warns when hbase.wal.split.to.hfile or 
hbase.hregion.edits.replay.skip.errors would bypass the re-ship.
   
   Tests: ReplicationWatermarkSimulationTest (randomised model), restore-hook 
unit tests, and ReplicationLogGroupIT checks for floor pinning (including after 
a ship that fails during a failover) and for skipping covered edits on replay. 
ReplicationLogGroupIT also waits for region moves and reopens instead of 
sleeping.


-- 
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]

Reply via email to