[
https://issues.apache.org/jira/browse/IGNITE-20309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nikita Amelchev updated IGNITE-20309:
-------------------------------------
Release Note: Fixed snapshot creation failing when check throws an exception
> 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
> Labels: ise
> Fix For: 2.16
>
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> 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)