[ https://issues.apache.org/jira/browse/IGNITE-20309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikolay Izhikov reassigned IGNITE-20309: ---------------------------------------- Assignee: Nikolay Izhikov > Snapshot creation returns OK even if check failed > ------------------------------------------------- > > Key: IGNITE-20309 > URL: https://issues.apache.org/jira/browse/IGNITE-20309 > Project: Ignite > Issue Type: Bug > Reporter: Nikolay Izhikov > Assignee: Nikolay Izhikov > Priority: Major > > Currently, {{SnapshotPartitionsQuickVerifyHandler#complete}} don't fail > snapshot even if {{invoke}} throws. > Reproducer: > > {noformat} > /** > * Test ensures that snapshot fail if during check some files are absent. > * @see SnapshotPartitionsQuickVerifyHandler > */ > @Test > public void testHandlerExceptionFailSnapshot() throws Exception { > handlers.add(new SnapshotHandler<Void>() { > @Override public SnapshotHandlerType type() { > return SnapshotHandlerType.CREATE; > } > @Override public Void invoke(SnapshotHandlerContext ctx) { > // Someone remove snapshot files during creation. > // In this case snapshot must fail. > U.delete(ctx.snapshotDirectory()); > return null; > } > }); > IgniteEx ignite = startGridsWithCache(1, CACHE_KEYS_RANGE, > valueBuilder(), dfltCacheCfg); > assertThrows( > null, > () -> snp(ignite).createSnapshot("must_fail", null, false, > onlyPrimary).get(getTestTimeout()), > IgniteException.class, > "Snapshot data doesn't contain required cache group partition" > ); > } > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)