[
https://issues.apache.org/jira/browse/HBASE-21644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16730008#comment-16730008
]
Duo Zhang commented on HBASE-21644:
-----------------------------------
{code}
// The openSeqNum must be increased every time when a region is assigned,
as we rely on it to
// determine whether a region has been successfully reopened. So here we
always write open
// marker, even if the table is read only.
if (wal != null && getRegionServerServices() != null &&
RegionReplicaUtil.isDefaultReplica(getRegionInfo())) {
writeRegionOpenMarker(wal, openSeqNum);
}
{code}
OK, the fix here is not for region replica. And here is the code for getting
openSeqNum
{code}
// Use maximum of log sequenceid or that which was found in stores
// (particularly if no recovered edits, seqid will be -1).
long maxSeqIdFromFile =
WALSplitter.getMaxRegionSequenceId(getWalFileSystem(), getWALRegionDir());
long nextSeqId = Math.max(maxSeqId, maxSeqIdFromFile) + 1;
// The openSeqNum will always be increase even for read only region, as we
rely on it to
// determine whether a region has been successfully reopend, so here we
always need to update
// the max sequence id file.
if (RegionReplicaUtil.isDefaultReplica(getRegionInfo())) {
LOG.debug("writing seq id for {}", this.getRegionInfo().getEncodedName());
WALSplitter.writeRegionSequenceIdFile(getWalFileSystem(),
getWALRegionDir(), nextSeqId - 1);
}
LOG.info("Opened {}; next sequenceid={}",
this.getRegionInfo().getShortNameToLog(), nextSeqId);
{code}
A bit strange that we do not take care about the region replicas when getting
max region sequence id but for writing, we will only write the max sequence id
for primary replica.
Maybe when getting we should also use the max sequence id from primary replica?
> Modify table procedure runs infinitely for a table having region replication
> > 1
> --------------------------------------------------------------------------------
>
> Key: HBASE-21644
> URL: https://issues.apache.org/jira/browse/HBASE-21644
> Project: HBase
> Issue Type: Bug
> Components: Admin
> Affects Versions: 3.0.0, 2.1.1, 2.1.2
> Reporter: Nihal Jain
> Assignee: Nihal Jain
> Priority: Critical
> Attachments: HBASE-21644.master.001.patch, HBASE-21644.master.UT.patch
>
>
> *Steps to reproduce*
> # Create a table with region replication set to a value greater than 1
> # Modify any of the table properties, say max file size
> *Expected Result*
> The modify table should succeed and run to completion.
> *Actual Result*
> The modify table keep running infinitely
> *Analysis/Issue*
> The problem occurs due to inifinitely looping between states
> {{REOPEN_TABLE_REGIONS_REOPEN_REGIONS}} and
> {{REOPEN_TABLE_REGIONS_CONFIRM_REOPENED}} of {{ReopenTableRegionsProcedure}},
> called as part of {{ModifyTableProcedure}}.
> *Consequences*
> For a table having region replicas:
> - Any modify table operation fails to complete
> - Also, enable table replication fails to complete as it is unable to change
> the replication scope of the table in source cluster
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)