Repository navigation
Conversation
| {:default 200 | ||
| :type Long}) | ||
|
|
||
| (defconfig force-delete-concept-by-params-db-batch-size |
| "auto" | ||
| (Long/parseLong val))) | ||
| :scroll-size (config/collection-delete-elastic-scroll-size) | ||
| :requests-per-second (config/collection-delete-elastic-requests-per-second) |
| {:default false | ||
| :type Boolean}) | ||
|
|
||
| (defconfig collection-delete-elastic-slices |
| :revision-date :transaction-id) | ||
| (dissoc deleted-coll :revision-date :transaction-id)))) | ||
|
|
||
| (defn- wait-until-granule-revisions-deleted |
There was a problem hiding this comment.
this is the updated delete test that @daniel-zamora wrote that was needed to be paired with the async coll delete changes in this PR
There was a problem hiding this comment.
Can you check here as well?
| {:error error-code :error-message error-message :throwable e})))] | ||
|
|
||
| ;; Only run the post-commit-step if the above save was 100% successful aka returned nil | ||
| (when (nil? save-result) |
There was a problem hiding this comment.
Could the background delete start from try-to-save once the transaction-id check passes? If that check rolls the tombstone back with a 409, granules of a still-live collection may already be getting deleted.
| ;; Only run the post-commit-step if the above save was 100% successful aka returned nil | ||
| (when (nil? save-result) | ||
| ;; start a separate thread to do the post-commit-step db actions | ||
| (future |
There was a problem hiding this comment.
Is it possible to run this too many times and use up the Oracle connection pool if we're deleting many large collections at once, for example through cleanup-expired-collections or a provider scripting deletes?
| (post-commit-step db provider concept) | ||
|
|
||
| (catch Exception e | ||
| (error e (format "ERROR - Background Oracle background process save-concept failed in post-commit-step for concept %s" (:concept-id concept))))))) |
There was a problem hiding this comment.
If this throws or metadata-db restarts mid-loop, the remaining granules stay under the tombstone and nothing picks them up again. Do we care about that?
| (Long/parseLong val))) | ||
| :scroll-size (config/collection-delete-elastic-scroll-size) | ||
| :requests-per-second (config/collection-delete-elastic-requests-per-second) | ||
| :max-wait-ms (* (config/index-delete-queue-max-wait-secs) 1000)} |
There was a problem hiding this comment.
Are there any pathways to this function that wouldn't want this max-wait-ms?
| :revision-date :transaction-id) | ||
| (dissoc deleted-coll :revision-date :transaction-id)))) | ||
|
|
||
| (defn- wait-until-granule-revisions-deleted |
There was a problem hiding this comment.
Can you check here as well?
| (let [e (second result) | ||
| ex-data-map (ex-data e)] | ||
|
|
||
| (if (and (< attempt max-attempts) (= :scroll-context-error (:type ex-data-map))) |
There was a problem hiding this comment.
Is it ever possible to wait too long, and have SQS redeliver the collection delete message?
Overview
What is the objective?
To let large collections be deleted properly without timeout or server errors
What are the changes?
NOTE: This was reverted a few days ago but is now back ready for PR.
Since the last PR, the only thing I changed was the default scroll-size, requests-per-sec and slices of the cascade collection delete
What areas of the application does this impact?
Cascade collection delete - ingest, indexer, metadata-db
Required Checklist
Additional Checklist