DRDataRaft/ docs
GitHub ↗

V21 Preview snapshot expiry

V21Adapters and additional tools5 steps

Use your current course session. Preparation and course runner · R script ↓

Optional deep dive. Enable only the options named in each block, after preparing its packages or services.

V21a Check a delivery deadline

Goal: Evaluate a business deadline.

Prerequisites: H27; extras.

Fixed UTC deadline and observation times keep the question reproducible.

training_step(
  "V21a",
  {
    delivery_check <- dataraft.lake::dr_check_delivery(
      training_lake,
      "policies",
      policy_contract,
      business_date = as.Date("2026-08-31"),
      due_at = as.POSIXct("2026-09-01 12:00:00", tz = "UTC"),
      at = as.POSIXct("2026-09-02 12:00:00", tz = "UTC"),
      record = FALSE
    )
    print(delivery_check)
  },
  needs = c("H27"),
  enabled = training_options$extras,
  optional = TRUE
)

Expected result: A deadline finding from available metadata. Newly generated technical receipt times may be after the example deadline.

Task: Why use record=FALSE?

Show solution

This is a retrospective exercise, not a new operational monitoring incident.

V21b Inspect interrupted runs

Goal: Review recovery before acting.

Prerequisites: H26; extras.

Do not deliberately crash the database. An empty finding is expected for a clean course run.

training_step(
  "V21b",
  {
    print(dataraft.lake::dr_interrupted(training_lake))
    print(dataraft.lake::dr_recover(training_lake, dry_run = TRUE))
  },
  needs = c("H26"),
  enabled = training_options$extras,
  optional = TRUE
)

Expected result: No interruption, or a recovery plan only.

Task: May you simply declare an unknown writer stopped?

Show solution

No. Establish the process state first. This exercise does not execute recovery.

V21c Verify release integrity

Goal: Compare stored content with retained evidence.

Prerequisites: H27; extras.

Verification may collect data in memory; the course datasets are small.

training_step(
  "V21c",
  {
    integrity <- dataraft.lake::dr_verify_releases(training_lake)
    print(integrity)
  },
  needs = c("H27"),
  enabled = training_options$extras,
  optional = TRUE
)

Expected result: Per-release status and diagnostics.

Task: Is a hash an externally tamper-proof seal?

Show solution

No. An administrator able to change both data and registry could change both.

V21d Plan cleanup

Goal: Inspect cleanup actions before execution.

Prerequisites: H26; extras.

dry_run=TRUE makes no changes.

training_step(
  "V21d",
  {
    print(dataraft.lake::dr_cleanup(
      training_lake,
      older_than_days = 30,
      dry_run = TRUE
    ))
  },
  needs = c("H26"),
  enabled = training_options$extras,
  optional = TRUE
)

Expected result: A cleanup plan, often empty for a new training lake.

Task: Should cleanup be applied blindly to production data?

Show solution

No. Review age, references and operational state first.

V21 Preview snapshot expiry

Goal: Handle retention deliberately.

Prerequisites: H26; a real DuckLake backend; extras.

Snapshot retention and file cleanup are operational choices. This exercise only previews them.

training_step(
  "V21",
  {
    print(dataraft.lake::dr_expire_snapshots(
      training_lake,
      older_than_days = 30,
      file_retention_days = 7,
      dry_run = TRUE
    ))
  },
  needs = c("H26"),
  enabled = training_options$extras,
  optional = TRUE
)

Expected result: A plan without deletion.

Task: What must be checked before actual cleanup?

Show solution

Active readers and the snapshots they need. This exercise deletes nothing.

Search documentation

Search functions, packages and guides.