[ 
https://issues.apache.org/jira/browse/HBASE-18490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16109233#comment-16109233
 ] 

ramkrishna.s.vasudevan commented on HBASE-18490:
------------------------------------------------

I checked the code. 
ServerRegionReplicaUtil#setupRegionReplicaReplication() is not for creaitng the 
regions. It sets up REGION_REPLICA_PEER and uses it to tail the WAL.
If you see the first line in this method
{code}
    if (!isRegionReplicaReplicationEnabled(conf)) {
      return;
    }
{code}
So if the config 'hbase.region.replica.replication.enabled' is not set then 
ideally we should not allow any region replica itself? Or even without this 
config we can create replica regions?
Now coming to this issue, 
I can see that ModifyTableProcedure is having the code to create the new 
replica regions 
{code}
      case MODIFY_TABLE_REMOVE_REPLICA_COLUMN:
        updateReplicaColumnsIfNeeded(env, unmodifiedHTableDescriptor, 
modifiedHTableDescriptor);
        if (deleteColumnFamilyInModify) {
          setNextState(ModifyTableState.MODIFY_TABLE_DELETE_FS_LAYOUT);
        } else {
          setNextState(ModifyTableState.MODIFY_TABLE_POST_OPERATION);
        }
{code}
WE just try to set up the REGION_REPILICA_PEER. But we don't add any replica 
regions to the META.
But coming to CreateTableProcedure
{code}
    // Add replicas if needed
    List<HRegionInfo> newRegions = addReplicas(env, hTableDescriptor, regions);

    // Add regions to META
    addRegionsToMeta(env, hTableDescriptor, newRegions);
{code}
We do the above and so the replica regions are added to META and infact we are 
able to open those regions. But down the code 
{code}
// Setup replication for region replicas if needed
    if (hTableDescriptor.getRegionReplication() > 1) {
      
ServerRegionReplicaUtil.setupRegionReplicaReplication(env.getMasterConfiguration());
    }
{code}
So this needs the 'hbase.region.replica.replication.enabled' to be true.

> Modifying a table descriptor to enable replicas does not create replica 
> regions
> -------------------------------------------------------------------------------
>
>                 Key: HBASE-18490
>                 URL: https://issues.apache.org/jira/browse/HBASE-18490
>             Project: HBase
>          Issue Type: Bug
>          Components: Region Assignment
>    Affects Versions: 1.3.1, 1.2.6, 2.0.0-alpha-1
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>         Attachments: TestRegionReplicasWithRestartScenarios.java
>
>
> After creating a table, if we try to modify the table to enable region 
> replication, the new Htable Descriptor is not taken into account and the 
> table is enabled again with default single region.
> Ping [~enis], [~tedyu], [~devaraj].



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to