Skip to content

Commit

Permalink
Merge branch 'main' into clean_fix_DayOfYearDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
xuezhou25 authored Oct 3, 2022
2 parents b825194 + c20446d commit 6df78f7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `reactor-netty-http` from 1.0.18 to 1.0.23
- Bumps `jettison` from 1.5.0 to 1.5.1
- Bumps `azure-storage-common` from 12.18.0 to 12.18.1
- Bumps `forbiddenapis` from 3.3 to 3.4


### Dependencies
Expand Down Expand Up @@ -90,6 +91,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Segment Replication] Ignore lock file when testing cleanupAndPreserveLatestCommitPoint ([#4544](https://github.com/opensearch-project/OpenSearch/pull/4544))
- Updated jackson to 2.13.4 and snakeyml to 1.32 ([#4556](https://github.com/opensearch-project/OpenSearch/pull/4556))
- [Bug]: Fixed day of year defaulting for round up parser ([#4627](https://github.com/opensearch-project/OpenSearch/pull/4627))
- Fixed the SnapshotsInProgress error during index deletion ([#4570](https://github.com/opensearch-project/OpenSearch/pull/4570))
- [Segment Replication] Adding check to make sure checkpoint is not processed when a shard's shard routing is primary ([#4630](https://github.com/opensearch-project/OpenSearch/pull/4630))
- [Bug]: Fixed invalid location of JDK dependency for arm64 architecture([#4613](https://github.com/opensearch-project/OpenSearch/pull/4613))
- [Bug]: Alias filter lost after rollover ([#4499](https://github.com/opensearch-project/OpenSearch/pull/4499))
Expand Down Expand Up @@ -121,4 +123,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)


[Unreleased]: https://github.com/opensearch-project/OpenSearch/compare/2.2.0...HEAD
[2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.2.0...2.x
[2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.2.0...2.x
2 changes: 1 addition & 1 deletion buildSrc/src/testKit/thirdPartyAudit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repositories {
}

dependencies {
forbiddenApisCliJar 'de.thetaphi:forbiddenapis:3.3'
forbiddenApisCliJar 'de.thetaphi:forbiddenapis:3.4'
jdkJarHell 'org.opensearch:opensearch-core:current'
compileOnly "org.${project.properties.compileOnlyGroup}:${project.properties.compileOnlyVersion}"
implementation "org.${project.properties.compileGroup}:${project.properties.compileVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,31 @@ public void testSnapshotDeleteRelocatingPrimaryIndex() throws Exception {
logger.info("--> done");
}

public void testIndexDeletionDuringSnapshotCreationInQueue() throws Exception {
assertAcked(prepareCreate("test-idx", 1, indexSettingsNoReplicas(1)));
ensureGreen();
indexRandomDocs("test-idx", 100);
createRepository("test-repo", "fs");
createSnapshot("test-repo", "test-snap", Collections.singletonList("test-idx"));

logger.info("--> create snapshot to be deleted and then delete");
createSnapshot("test-repo", "test-snap-delete", Collections.singletonList("test-idx"));
clusterAdmin().prepareDeleteSnapshot("test-repo", "test-snap-delete").execute();

logger.info("--> create snapshot before index deletion during above snapshot deletion");
clusterAdmin().prepareCreateSnapshot("test-repo", "test-snap-2")
.setWaitForCompletion(false)
.setPartial(true)
.setIndices("test-idx")
.get();

logger.info("delete index during snapshot creation");
assertAcked(admin().indices().prepareDelete("test-idx"));

clusterAdmin().prepareRestoreSnapshot("test-repo", "test-snap").get();
ensureGreen("test-idx");
}

private long calculateTotalFilesSize(List<Path> files) {
return files.stream().mapToLong(f -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2965,8 +2965,14 @@ private SnapshotsInProgress updatedSnapshotsInProgress(ClusterState currentState
updatedAssignmentsBuilder.put(shardId, updated);
}
}
snapshotEntries.add(entry.withStartedShards(updatedAssignmentsBuilder.build()));
final SnapshotsInProgress.Entry updatedEntry = entry.withShardStates(updatedAssignmentsBuilder.build());
snapshotEntries.add(updatedEntry);
changed = true;
// When all the required shards for a snapshot are missing, the snapshot state will be "completed"
// need to finalize it.
if (updatedEntry.state().completed()) {
newFinalizations.add(entry);
}
}
} else {
// Entry is already completed so we will finalize it now that the delete doesn't block us after
Expand Down

0 comments on commit 6df78f7

Please sign in to comment.