Vladsz83 commented on code in PR #13577:
URL: https://github.com/apache/ignite/pull/13577#discussion_r4303418289
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java:
##########
@@ -814,6 +862,86 @@ public static void doSnapshotCancellationTest(
assertEquals("Snapshot directory must be empty due to snapshot
cancelled", 0, snpDir.list().length);
}
+ /** Tests concurrent snapshot operation when snapshot deletion with the
same name is active. */
+ protected void doConcurrentSnapshotOperationWhenDeletionIsActive(
+ ExRunnable prepareCluster,
+ ExRunnable concurrentOp,
+ @Nullable Function<Exception, Boolean> errValidator,
+ boolean rerunAtTheEnd
+ ) throws Exception {
+ CountDownLatch delProcInitLatch = new CountDownLatch(1);
+ CountDownLatch delProcProceedLatch = new CountDownLatch(1);
+
+ pluginProvider = new AbstractTestPluginProvider() {
+ @Override public String name() {
+ return "TestSnpMgrProvider";
+ }
+
+ @Override public <T> T createComponent(PluginContext ctx, Class<T>
cls) {
+ if (IgniteSnapshotManager.class.isAssignableFrom(cls)) {
+ return (T)new
IgniteSnapshotManager(((IgniteEx)ctx.grid()).context()) {
+ @Override public T2<Boolean, Boolean>
deleteLocalSnapshot(
+ SnapshotFileTree sft,
+ boolean scoped,
+ boolean ignoreErrs
+ ) {
+ delProcInitLatch.countDown();
+
+ try {
+
assertTrue(delProcProceedLatch.await(getTestTimeout(), TimeUnit.MILLISECONDS));
+ }
+ catch (InterruptedException e) {
+ throw new RuntimeException("Interrupted.", e);
+ }
+
+ return super.deleteLocalSnapshot(sft, scoped,
ignoreErrs);
+ }
+ };
+ }
+
+ return super.createComponent(ctx, cls);
+ }
+ };
+
+ prepareCluster.run();
+
+ IgniteInternalFuture<SnapshotDeleteProcessResult> delFut =
snp(grid(0)).deleteSnapshot(SNAPSHOT_NAME, null);
Review Comment:
> no take into account FS sensitivity, thus, as i say before - global flag
looks very strange
The FS sensitivity is taken in account in (at least as an idea):
`testConcurrentSnapshotDeleteAndCheckOperations()`
`testConcurrentDeleteOfTheSameSnapshot()`
`testConcurrentSnapshotDeleteAndRestoreOperations()`
`testConcurrentSnapshotDeleteOperation()`
`testConcurrentSnapshotDeleteOperationWithDifferentPath()`
All the use simple approch:
1) We know that the snapshot deletion in
`doConcurrentSnapshotOperationWhenDeletionIsActive()` is performed with
`SNAPSHOT_NAME` (not changing).
2) We use a case changed snapshot name in the optional/configured concurrent
operation which must ne blocked in on a case insensitive FS
--
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]