-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-25955 Setting NAMESPACES when adding a replication peer doesn't… #3347
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,13 @@ | |
import org.apache.hadoop.hbase.HConstants; | ||
import org.apache.hadoop.hbase.TableName; | ||
import org.apache.hadoop.hbase.Waiter.ExplainingPredicate; | ||
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; | ||
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; | ||
import org.apache.hadoop.hbase.client.Put; | ||
import org.apache.hadoop.hbase.client.RegionInfo; | ||
import org.apache.hadoop.hbase.client.Table; | ||
import org.apache.hadoop.hbase.client.TableDescriptor; | ||
import org.apache.hadoop.hbase.client.TableDescriptorBuilder; | ||
import org.apache.hadoop.hbase.testclassification.MediumTests; | ||
import org.apache.hadoop.hbase.testclassification.ReplicationTests; | ||
import org.apache.hadoop.hbase.util.Bytes; | ||
|
@@ -89,14 +93,18 @@ public void testRemoveTable() throws Exception { | |
waitUntilHasLastPushedSequenceId(region); | ||
|
||
UTIL.getAdmin().updateReplicationPeerConfig(PEER_ID, | ||
ReplicationPeerConfig.newBuilder(peerConfig).setTableCFsMap(Collections.emptyMap()).build()); | ||
ReplicationPeerConfig.newBuilder(peerConfig) | ||
.setTableCFsMap(Collections.emptyMap()) | ||
.setReplicateAllUserTables(true) | ||
.setExcludeTableCFsMap(ImmutableMap.of(tableName, Collections.emptyList())).build()); | ||
|
||
Comment on lines
+92
to
96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous test behaviour isn't valid anymore, as it was relying on an empty |
||
ReplicationQueueStorage queueStorage = | ||
UTIL.getMiniHBaseCluster().getMaster().getReplicationPeerManager().getQueueStorage(); | ||
assertEquals(HConstants.NO_SEQNUM, | ||
queueStorage.getLastSequenceId(region.getEncodedName(), PEER_ID)); | ||
} | ||
|
||
|
||
@Test | ||
public void testRemoveSerialFlag() throws Exception { | ||
TableName tableName = createTable(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means when any of the wildcard kind of setting (like one NS for include) is present, a per table:cf setting wont get honoured?
To be specific say we have 2 NS, ns1 and ns2. Now ns1 is in the include NS list. So all tables in ns1 to be replicated. Thats it. ns2 is neither in include list nor in exclude list. But ns2 having one table with CFs of replication scope = 1. But as per this change we will not consider those tables for replication as scopeFilter wont come in then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be the case. The given table/CF should be in the namespace passed, or in the TableCFsMap defined in the addPeer command. It does break compatibility, but it's still possible to achieve the same level of granularity by using a combination of ExcludeTableCFsMap/ExcludeNamespaces/namespaces/TableCFsMap, which is much more convenient than having to alter table schema (which also requires table to be offline).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way we can avoid the compatibility break? May be a bigger change but can we think ways? The WALEntryFilter s to act in an OR fashion? The chain is more or less an AND model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe come up with an extra, namespace only filter, then?