dlmarion commented on code in PR #3835:
URL: https://github.com/apache/accumulo/pull/3835#discussion_r1360747484
##########
test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java:
##########
@@ -413,24 +415,41 @@ public void testOpidPreventsAssignment() throws Exception
{
writer.addMutation(m);
}
+ // Host all tablets.
c.tableOperations().setTabletHostingGoal(tableName, new Range(),
TabletHostingGoal.ALWAYS);
+ Wait.waitFor(() -> countTabletsWithLocation(c, tableId) == 3);
Review Comment:
Added in 6ab6766
##########
test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java:
##########
@@ -413,24 +415,41 @@ public void testOpidPreventsAssignment() throws Exception
{
writer.addMutation(m);
}
+ // Host all tablets.
c.tableOperations().setTabletHostingGoal(tableName, new Range(),
TabletHostingGoal.ALWAYS);
+ Wait.waitFor(() -> countTabletsWithLocation(c, tableId) == 3);
- Wait.waitFor(() -> countTabletsWithLocation(c, tableId) >= 3);
+ // Delete the OperationId column, tablet should be assigned
+ try (var writer = c.createBatchWriter(MetadataTable.NAME)) {
+ var extent = new KeyExtent(tableId, new Text("m"), new Text("f"));
+ Mutation m = new Mutation(extent.toMetaRow());
+ TabletsSection.ServerColumnFamily.OPID_COLUMN.putDelete(m);
+ writer.addMutation(m);
+ }
+ Wait.waitFor(() -> countTabletsWithLocation(c, tableId) == 4);
- // there are four tablets, but one has an operation id set and should
not be assigned
- assertEquals(3, countTabletsWithLocation(c, tableId));
+ // Set the OperationId on one tablet, which will cause that tablet
+ // to be unhosted
+ try (var writer = c.createBatchWriter(MetadataTable.NAME)) {
+ var extent = new KeyExtent(tableId, new Text("m"), new Text("f"));
+ var opid = TabletOperationId.from(TabletOperationType.SPLITTING, 42L);
+ Mutation m = new Mutation(extent.toMetaRow());
+ TabletsSection.ServerColumnFamily.OPID_COLUMN.put(m, new
Value(opid.canonical()));
+ writer.addMutation(m);
+ }
+ // there are four tablets, three should be assigned as one has a
OperationId
+ Wait.waitFor(() -> countTabletsWithLocation(c, tableId) == 3);
Review Comment:
Added in 6ab6766
--
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]