Compare commits

..
Author SHA1 Message Date
James MaesandClaude Fable 5.2 8252d4fb14 Merge develop into release/0.1 (fix(schedule): the daily prune prunes, and plans run on their schedule without a scheduled jobs table)
maven / build (push) Successful in 2m52s
build / maven (push) Successful in 2m52s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 05:20:52 -06:00
CI 1f916556a2 Bump version to 0.1.0-RC.13 [skip ci] 2026-11-24 10:45:34 +00:00
james.maes f4de56dd9e Merge pull request 'Merge develop into release/0.1 (next release candidate)' (#56) from merge/develop-into-release-0.1-0441 into release/0.1
maven / build (push) Successful in 2m21s
build / maven (push) Successful in 2m21s
2026-11-24 10:43:22 +00:00
James MaesandClaude Fable 5.2 1f2557e96c Merge develop into release/0.1 (feat(encryption): client-side encryption works, from the plan to the restore)
maven / build (push) Successful in 1m49s
build / maven (push) Successful in 1m49s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 04:41:11 -06:00
CI 5adc79976d Bump version to 0.1.0-RC.12 [skip ci] 2026-11-07 18:26:34 +00:00
james.maes 0eb18a36da Merge pull request 'Merge develop into release/0.1 (Gitea-aligned RC)' (#54) from align/develop-into-release-0.1 into release/0.1
maven / build (push) Successful in 5m8s
build / maven (push) Successful in 5m8s
2026-11-07 18:11:14 +00:00
james.maesandClaude Opus 5.5 4d56012352 Merge develop into release/0.1 (Gitea-aligned RC)
maven / build (push) Canceled after 0s
build / maven (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:10:56 -06:00
james.maesandCodex a17c6739bb ci: centralize release branch verification and workflows (#42)
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 12:40:15 -05:00
CircleCI 11156c8e8c Bump version to 0.1.0-RC.11 [skip ci] 2026-10-16 16:57:05 +00:00
james.maesandClaude Opus 5.5 0cc273bb52 Merge develop into release/0.1 for 0.1.0-RC.11 (#33 skip non-queryable tables, full error detail)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:54:24 -05:00
CircleCI 036cd45f32 Bump version to 0.1.0-RC.10 [skip ci] 2026-10-16 16:31:49 +00:00
github-actions[bot] eaa6c9b93a Merge develop into release/0.1 for the next 0.1.0 RC 2026-10-16 15:57:53 +00:00
CircleCI 33cb1f7a17 Bump version to 0.1.0-RC.9 [skip ci] 2026-10-15 19:24:05 +00:00
james.maesandClaude Opus 5.5 773629d253 Merge develop into release/0.1 for 0.1.0-RC.9 (cluster caches, QQQ RC.14)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:20:21 -05:00
CircleCI 9855521637 Bump version to 0.1.0-RC.8 [skip ci] 2026-10-15 03:36:37 +00:00
james.maesandClaude Opus 5.5 99f74b4b5f Merge develop into release/0.1 for 0.1.0-RC.8 (#23 health checks)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:32:35 -05:00
CircleCI fa9c4c1774 Bump version to 0.1.0-RC.7 [skip ci] 2026-10-15 02:21:57 +00:00
james.maesandClaude Opus 5.5 c8ba79f55b Merge develop into release/0.1 for 0.1.0-RC.7 (#26 QQQ RC.8, #27 help bundle)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:18:12 -05:00
CircleCI 7830226982 Bump version to 0.1.0-RC.6 [skip ci] 2026-10-14 22:44:27 +00:00
james.maesandClaude Opus 5.5 b1f258a3d5 Merge develop into release/0.1 for 0.1.0-RC.6 (#24)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:41:40 -05:00
CircleCI 3df24cda5a Bump version to 0.1.0-RC.5 [skip ci] 2026-10-14 22:22:38 +00:00
james.maesandClaude Opus 5.5 987c20899b Merge develop into release/0.1 for 0.1.0-RC.5 (#25 setup card, default plan, scheduled verify)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:19:54 -05:00
CircleCI 14bb6fa1b4 Bump version to 0.1.0-RC.4 [skip ci] 2026-10-14 12:26:09 +00:00
james.maesandClaude Opus 5.5 b1ff70d7d3 Merge develop into release/0.1 for 0.1.0-RC.4 (#21 schema fingerprint, keyset pager, guardrails)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 07:21:32 -05:00
CircleCI cda334f2fe Bump version to 0.1.0-RC.3 [skip ci] 2026-10-14 00:53:05 +00:00
james.maesandClaude Opus 5.5 590b132fb6 Merge develop into release/0.1 for 0.1.0-RC.3 (core alerts, renamed alert types, #20)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 19:50:34 -05:00
CircleCI f0a8c5000e Bump version to 0.1.0-RC.2 [skip ci] 2026-10-13 16:11:19 +00:00
james.maesandClaude Opus 5.5 8f3f9ec60a Merge develop into release/0.1 for 0.1.0-RC.2
qbit-object-storage 0.1.0-RC.2 (AWS SDK v2 2.41.34, GHSA-443w-3rq3-5m5h; #17).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:08:28 -05:00
CircleCI cdaf218201 Bump version to 0.1.0-RC.1 [skip ci] 2026-10-13 00:26:41 +00:00
7 changed files with 4 additions and 113 deletions

No files matched your search

-1
View File
@@ -19,7 +19,6 @@ All notable changes to this project are documented here. The format follows Keep
- Repository scaffold: `BackupsQBitConfig` and `BackupsQBitProducer` (table prefix `backups_`, permissions `backups.*`), build, CI and repository standard files.
### Changed
- **A plan with an unfinished backup could not be pruned on real storage.** A listing through the object-storage qbit dropped each object's modification time, and the pruner compared those times to find backups that never finished and are older than 7 days: with one failed run under a plan, every prune of that plan threw. The listing carries the time now, and the pruner dates an unfinished backup by its run record where a storage lists no times (and never deletes as old what it cannot date). The in-memory storage of the tests supplies times, which is why no test saw it; a host's live check did.
- **The daily prune prunes.** It is a process of its own, `backupPruneScheduled` (`BackupScheduledPruneProcess`), which prunes every active plan with nobody selecting anything. The schedule used to be on "Prune per retention" (`backupPrune`), an action for a person that needs plans selected and a review: started by a scheduler it answered "No records were selected", the scheduler logged a warning, and no old backup was ever deleted by the schedule. `backupPrune` has no schedule now. A host that scheduled it itself should stop.
- The file index of an encrypted run (`files/index-00001.jsonl.gz`: tables, record keys and where each file came from) is encrypted like every other object of the run. It was written in the clear while the catalog recorded it as encrypted, and a restore from an encrypted run could not read it. No release could encrypt before this one, so no stored run is affected.
- A plan that asks for encryption without a key provider is refused with "no key provider is configured" (was "not available in this version"); a refused run names the key reference.
+1 -1
View File
@@ -21,7 +21,7 @@
<qqq.version>4.1.0-RC.26</qqq.version> <!-- feeds qbit-build-parent's qqq-bom-pom import -->
<qbit.guardrails.enforce>true</qbit.guardrails.enforce>
<qbit.guardrails.strictUiApiRoutes>true</qbit.guardrails.strictUiApiRoutes>
<revision>0.1.0-SNAPSHOT</revision>
<revision>0.1.0-RC.13</revision>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<jacoco.version>0.8.15</jacoco.version>
@@ -425,44 +425,6 @@ public class BackupPruner
/*******************************************************************************
** Prefixes of the plan that never got a manifest and are old enough.
*******************************************************************************/
/*******************************************************************************
** When the newest object of an unfinished backup was written. A storage may
** list objects without their times: then the run's own record dates them (its
** end, else its start), and where there is no run record either the prefix is
** taken as written now, so nothing that cannot be dated is deleted as old.
*******************************************************************************/
static Instant newestOf(List<StoredObjectInfo> objects, QRecord run, Instant now)
{
Instant newest = null;
boolean undated = false;
for(StoredObjectInfo object : objects)
{
if(object.lastModified() == null)
{
undated = true;
}
else if(newest == null || object.lastModified().isAfter(newest))
{
newest = object.lastModified();
}
}
if(!undated && newest != null)
{
return (newest);
}
Instant recorded = run == null ? null : run.getValueInstant("endDate") != null ? run.getValueInstant("endDate") : run.getValueInstant("startDate");
if(recorded == null)
{
return (now);
}
return (newest != null && newest.isAfter(recorded) ? newest : recorded);
}
/*******************************************************************************
** The prefixes of backups that never finished and are old enough to delete.
*******************************************************************************/
private List<DebrisPlan> debris(QRecord plan, List<QRecord> allRuns, BackupStorage deleteSide, Instant now) throws QException
{
String prefix = planPrefix(plan);
@@ -499,7 +461,7 @@ public class BackupPruner
{
continue;
}
Instant newest = newestOf(objects, run, now);
Instant newest = objects.stream().map(StoredObjectInfo::lastModified).max(Comparator.naturalOrder()).orElse(now);
if(newest.isAfter(now.minus(Duration.ofDays(PruneCalculator.DEBRIS_DAYS))))
{
continue;
@@ -128,18 +128,7 @@ public class BackupScheduledPruneProcess implements BackendStep
// failure it was; a message could carry a key or an endpoint //
///////////////////////////////////////////////////////////////////////////
failed++;
if(e instanceof RuntimeException)
{
//////////////////////////////////////////////////////////////////////////
// a defect, not a condition of the storage: its stack trace says where, //
// and holds no data //
//////////////////////////////////////////////////////////////////////////
LOG.warn("A backup plan could not be pruned", e, logPair("plan", planKey));
}
else
{
LOG.warn("A backup plan could not be pruned", logPair("plan", planKey), logPair("failure", e.getClass().getSimpleName()));
}
LOG.warn("A backup plan could not be pruned", logPair("plan", planKey), logPair("failure", e.getClass().getSimpleName()));
BackupAlerts.raise(BackupAlerts.PRUNE_FAILED, planKey, BackupAlertSink.Severity.WARNING, "Old backups of " + plan.getValueString("name") + " could not be deleted",
"plan", planKey, "failure", e.getClass().getSimpleName());
}
@@ -323,7 +323,7 @@ public class ObjectStorageBackupStorage implements BackupStorage
Page<ObjectSummary> page = bucket.list(ListRequest.prefix(prefix == null ? "" : prefix).pageSize(1000).after(after));
for(ObjectSummary summary : page.getItems())
{
rs.add(new StoredObjectInfo(summary.getKey(), summary.getSize() == null ? 0 : summary.getSize(), summary.getLastModified(), new LinkedHashMap<>(), null));
rs.add(new StoredObjectInfo(summary.getKey(), summary.getSize() == null ? 0 : summary.getSize(), null, new LinkedHashMap<>(), null));
}
after = page.getNextToken();
}
@@ -317,63 +317,6 @@ class BackupPrunerTest
/*******************************************************************************
** A storage that lists objects without their modification times (a listing
** through the object-storage qbit did, for every real bucket) used to make the
** pruner throw as soon as a plan had one unfinished backup, so that plan was
** never pruned again. The run's own record dates the debris: it is deleted when
** the run ended more than 7 days ago, kept before, and a prefix with no times
** and no run record is never deleted as old.
*******************************************************************************/
@Test
void testDebrisIsDatedByItsRunWhenTheStorageListsNoTimes() throws Exception
{
QRecord plan = plan(7, Map.of());
BackupsTestUtils.BACKUPS.withFailWritesFor(key -> key.contains("/tables/blogPost/"));
BackupRunResult failed = new BackupRunCoordinator().runPlan(plan, "SCHEDULED");
BackupsTestUtils.BACKUPS.withFailWritesFor(null);
assertThat(failed.getStatus()).isEqualTo("FAILED");
runOnDay(plan, 6);
com.kingsrook.qbits.backups.storage.BackupStorage noTimes = (com.kingsrook.qbits.backups.storage.BackupStorage) java.lang.reflect.Proxy.newProxyInstance(
getClass().getClassLoader(), new Class<?>[] { com.kingsrook.qbits.backups.storage.BackupStorage.class }, (proxy, method, args) ->
{
try
{
Object answer = method.invoke(BackupsTestUtils.BACKUPS, args);
if("list".equals(method.getName()))
{
List<StoredObjectInfo> listed = new java.util.ArrayList<>();
for(Object each : (List<?>) answer)
{
StoredObjectInfo object = (StoredObjectInfo) each;
listed.add(new StoredObjectInfo(object.key(), object.size(), null, object.metadata(), object.lockedUntil()));
}
return (listed);
}
return (answer);
}
catch(java.lang.reflect.InvocationTargetException e)
{
throw (e.getCause());
}
});
BackupsRuntime.getConfig().withStorageResolver(alias -> "backups".equals(alias) ? noTimes : BackupsTestUtils.MEDIA);
clock.set(DAY_1.plus(Duration.ofDays(6)));
assertThat(new BackupPruner().plan(plan).debris()).as("6 days after the run ended it is not debris yet").isEmpty();
clock.set(DAY_1.plus(Duration.ofDays(8)));
BackupPruner.Outcome outcome = new BackupPruner().prune(plan, "tester");
assertThat(outcome.debrisPrefixesDeleted()).isEqualTo(1);
assertThat(BackupsTestUtils.BACKUPS.list(failed.getRunPrefix())).isEmpty();
Instant now = DAY_1.plus(Duration.ofDays(30));
assertThat(BackupPruner.newestOf(List.of(new StoredObjectInfo("orphan/part", 1, null, Map.of(), null)), null, now)).as("no times and no run record: not old").isEqualTo(now);
}
/*******************************************************************************
** The prefix of a run that never got a manifest is debris once its newest object
** is older than 7 days, and not before.
@@ -142,8 +142,6 @@ class ObjectStorageBackupStorageMinioTest
storage.copy("contract/big.bin", "contract/copy.bin");
assertThat(storage.list("contract/")).extracting(StoredObjectInfo::key).containsExactly("contract/big.bin", "contract/copy.bin");
assertThat(storage.list("contract/")).as("a listing says when each object was written: the pruner dates unfinished backups by it")
.allSatisfy(object -> assertThat(object.lastModified()).isNotNull());
assertThat(storage.presignGet("contract/copy.bin", Duration.ofMinutes(15), "x.bin")).startsWith("http");
assertThat(storage.deletePermanent("contract/copy.bin")).isEqualTo(BackupStorage.DeleteResult.DELETED);
assertThat(storage.deletePermanent("contract/copy.bin")).isEqualTo(BackupStorage.DeleteResult.NOT_FOUND);