Skip to content
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

OAK-11299: Missing Segments With Oak Run Segment Copy #1892

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public int run() {

} catch (Exception e) {
watch.stop();
printMessage(errWriter, "A problem occured while copying archives from {0} to {1} ", source,
printMessage(errWriter, "A problem occurred while copying archives from {0} to {1} ", source,
destination);
e.printStackTrace(errWriter);
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,13 @@ private void migrateArchives() throws IOException, ExecutionException, Interrupt
List<String> targetArchives = targetManager.listArchives();

if (appendMode && !targetArchives.isEmpty()) {
//last archive can be updated since last copy and needs to be recopied
String lastArchive = targetArchives.get(targetArchives.size() - 1);
targetArchives.remove(lastArchive);
// last archive could have been updated since last copy and needs to be recopied
try {
targetArchives.sort(String::compareTo);
targetArchives.remove(targetArchives.size() - 1);
} catch (UnsupportedOperationException e) {
targetArchives = targetArchives.subList(0, targetArchives.size() - 1);
}
}

for (String archiveName : sourceManager.listArchives()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,11 @@ SegmentArchiveEntry[] getEntries() {
*/
@NotNull
private static List<UUID> getReferences(UUID id, Map<UUID, List<UUID>> graph) {
List<UUID> references = graph.get(id);
if (graph == null) {
return Collections.emptyList();
}

List<UUID> references = graph.get(id);
if (references == null) {
return Collections.emptyList();
}
Expand Down Expand Up @@ -550,8 +553,9 @@ TarReader sweep(@NotNull Set<UUID> reclaim, @NotNull Set<UUID> reclaimed) throws
// Reconstruct the graph index for non-cleaned segments.

Map<UUID, List<UUID>> graph = getGraph();
Set<Entry<UUID, List<UUID>>> entrySet = (graph == null) ? Collections.emptySet() : graph.entrySet();

for (Entry<UUID, List<UUID>> e : graph.entrySet()) {
for (Entry<UUID, List<UUID>> e : entrySet) {
if (cleaned.contains(e.getKey())) {
continue;
}
Expand Down