[
https://issues.apache.org/jira/browse/PHOENIX-7989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tanuj Khurana resolved PHOENIX-7989.
------------------------------------
Resolution: Fixed
> Fix close-resurrection double-writer in ReplicationLogGroup
> -----------------------------------------------------------
>
> Key: PHOENIX-7989
> URL: https://issues.apache.org/jira/browse/PHOENIX-7989
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Tanuj Khurana
> Assignee: Tanuj Khurana
> Priority: Major
>
> close() removed the instance from INSTANCES at the top, before a multi-second
> disruptor drain. A concurrent get() during that window missed the cache and
> constructed a second live instance for the same shard, producing two writers
> (confirmed in a captured abort log).
> Remove from the cache only after teardown, in a finally so a throwing
> teardown step cannot strand a closed instance (which would break the
> active->standby->active re-promotion path without a JVM restart). The removal
> is value-specific (remove(key, this)) so a later instance for the same key is
> never clobbered. The closed flag is still set first, so a get() during the
> drain returns the still-closing instance whose append()/sync() fail fast
> rather than a fresh writer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)