Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CADC-13234 fix ringhold for ArtifactDAO API change #564

Merged
merged 7 commits into from
Apr 3, 2024
22 changes: 15 additions & 7 deletions ringhold/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Storage Inventory local artifact removal process (ringhold)
# Storage Inventory local artifact deletion process (ringhold)

Process to remove local artifacts that are no longer being synchronised by fenwick. This tool is used
Process to delete local artifacts that are no longer being synchronised by fenwick. This tool is used
to perform quick cleanup at a storage site after changing the fenwick artifact-filter policy.
pdowler marked this conversation as resolved.
Show resolved Hide resolved

## configuration
Expand All @@ -18,17 +18,25 @@ org.opencadc.ringhold.inventory.schema={schema for inventory database objects}
org.opencadc.ringhold.inventory.username={username for inventory admin}
org.opencadc.ringhold.inventory.password={password for inventory admin}
org.opencadc.ringhold.inventory.url=jdbc:postgresql://{server}/{database}

# artifact namespace
org.opencadc.ringhold.namespace={storage site namespace}
pdowler marked this conversation as resolved.
Show resolved Hide resolved

# artifact uri bucket filter (optional)
org.opencadc.ringhold.buckets={uriBucket prefix or range of prefixes}
```
The `inventory` account owns and manages all the content (insert, update, delete) in the inventory schema. Unlike
other components that modify inventory content, this component **does not initialise** the database objects because
it never makes sense to run this in a new/empty database. The database is specified in the JDBC URL. Failure to
connect to a pre-initialised database will show up in logs.

### artifact-deselector.sql
Contains a SQL clause used as a WHERE constraint. The clause returns Artifact's that match the URI pattern.
```
WHERE uri LIKE 'cadc:CFHT/%'
```
The `namespace` is the prefix of the Artifact URI's to be deleted. The `namespace` must end with a colon (:)
or slash (/) so one namespace cannot accidentally match (be a prefix of) another namespace. Multiple values
of `namespace` may be specified, one per line.

The `buckets` value indicates a subset of artifacts to delete. The range of uri bucket prefixes is specified
with two values separated by a single - (dash) character; whitespace is ignored. Multiple instances of `ringhold`
can be run (in parallel) to subdivide the work as long as the range of buckets do not overlap.

## building it
```
Expand Down
Loading