You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "keith-turner (via GitHub)" <gi...@apache.org> on 2024/02/13 20:16:50 UTC
[PR] fixes SplitRecoveryIT to work with newer columns [accumulo]
keith-turner opened a new pull request, #4260:
URL: https://github.com/apache/accumulo/pull/4260
SplitRecoveryIT is a tricky test to maintain because it is testing upgrade code that deals with older metadata columns that Accumulo no longer recognizes. This commit adjust the test to work with recent changes to the metadata schema in the elasticity branch.
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fixes SplitRecoveryIT to work with newer columns [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4260:
URL: https://github.com/apache/accumulo/pull/4260#discussion_r1489667323
##########
test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java:
##########
@@ -189,12 +187,26 @@ private void runSplitRecoveryTest(ServerContext context, int failPoint, String m
private static Map<Long,List<ReferencedTabletFile>> getBulkFilesLoaded(ServerContext context,
KeyExtent extent) {
- Map<Long,List<ReferencedTabletFile>> bulkFiles = new HashMap<>();
- context.getAmple().readTablet(extent).getLoaded().forEach((path, txid) -> bulkFiles
- .computeIfAbsent(txid, k -> new ArrayList<>()).add(path.getTabletFile()));
+ // Ample is not used here because it does not recognize some of the old columns that this
+ // upgrade code is dealing with.
+ try (Scanner scanner =
+ context.createScanner(AccumuloTable.METADATA.tableName(), Authorizations.EMPTY)) {
+ scanner.setRange(extent.toMetaRange());
+
+ Map<Long,List<ReferencedTabletFile>> bulkFiles = new HashMap<>();
+ for (var entry : scanner) {
+ if (entry.getKey().getColumnFamily().equals(BulkFileColumnFamily.NAME)) {
+ var path = new StoredTabletFile(entry.getKey().getColumnQualifier().toString());
+ var txid = BulkFileColumnFamily.getBulkLoadTid(entry.getValue());
+ bulkFiles.computeIfAbsent(txid, k -> new ArrayList<>()).add(path.getTabletFile());
+ }
+ }
Review Comment:
[These columns](https://github.com/apache/accumulo/blob/5d12597b4dedb60524775d0411405bafc3ee86ce/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java#L427-L433) are handled on upgrade by the code this class is testing. If Ample sees those columns it throws an exception.
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fixes SplitRecoveryIT to work with newer columns [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4260:
URL: https://github.com/apache/accumulo/pull/4260#discussion_r1488524048
##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/SplitRecovery12to13.java:
##########
@@ -67,37 +58,6 @@ public class SplitRecovery12to13 {
private static final Logger log = LoggerFactory.getLogger(SplitRecovery12to13.class);
- public static void addNewTablet(ServerContext context, KeyExtent extent, String dirName,
Review Comment:
The two method that were removed from the class were moved to the integration test because it was the only thing using them. Thought it made it more clear that this code was only used by test code.
##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/SplitRecovery12to13.java:
##########
@@ -67,37 +58,6 @@ public class SplitRecovery12to13 {
private static final Logger log = LoggerFactory.getLogger(SplitRecovery12to13.class);
- public static void addNewTablet(ServerContext context, KeyExtent extent, String dirName,
Review Comment:
The two methods that were removed from this class were moved to the integration test because it was the only thing using them. Thought it made it more clear that this code was only used by test code.
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fixes SplitRecoveryIT to work with newer columns [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner merged PR #4260:
URL: https://github.com/apache/accumulo/pull/4260
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fixes SplitRecoveryIT to work with newer columns [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #4260:
URL: https://github.com/apache/accumulo/pull/4260#discussion_r1489624839
##########
test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java:
##########
@@ -189,12 +187,26 @@ private void runSplitRecoveryTest(ServerContext context, int failPoint, String m
private static Map<Long,List<ReferencedTabletFile>> getBulkFilesLoaded(ServerContext context,
KeyExtent extent) {
- Map<Long,List<ReferencedTabletFile>> bulkFiles = new HashMap<>();
- context.getAmple().readTablet(extent).getLoaded().forEach((path, txid) -> bulkFiles
- .computeIfAbsent(txid, k -> new ArrayList<>()).add(path.getTabletFile()));
+ // Ample is not used here because it does not recognize some of the old columns that this
+ // upgrade code is dealing with.
+ try (Scanner scanner =
+ context.createScanner(AccumuloTable.METADATA.tableName(), Authorizations.EMPTY)) {
+ scanner.setRange(extent.toMetaRange());
+
+ Map<Long,List<ReferencedTabletFile>> bulkFiles = new HashMap<>();
+ for (var entry : scanner) {
+ if (entry.getKey().getColumnFamily().equals(BulkFileColumnFamily.NAME)) {
+ var path = new StoredTabletFile(entry.getKey().getColumnQualifier().toString());
+ var txid = BulkFileColumnFamily.getBulkLoadTid(entry.getValue());
+ bulkFiles.computeIfAbsent(txid, k -> new ArrayList<>()).add(path.getTabletFile());
+ }
+ }
Review Comment:
So, this looks like the real change here, the other changes are due to the method moves. What is the old column here?
--
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: notifications-unsubscribe@accumulo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org