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

Avoid storing the resource contents in the case of a soft delete #3293

Closed
lmsurpre opened this issue Feb 7, 2022 · 7 comments
Closed

Avoid storing the resource contents in the case of a soft delete #3293

lmsurpre opened this issue Feb 7, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Feb 7, 2022

Is your feature request related to a problem? Please describe.
In versioned FHIR servers (like ours), the DELETE action is a "soft delete"... its actually more like an update where we set the delete flag to Y.

Despite the resource content being logically deleted, for historical reasons we always write a new version of the entire resource payload in the db on this deleted version.

Describe the solution you'd like
Stop writing the resource payload on the deleted version of this record.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Acceptance Criteria

  1. GIVEN [a precondition]
    AND [another precondition]
    WHEN [test step]
    AND [test step]
    THEN [verification step]
    AND [verification step]

Additional context
In a previous iteration of the DB, I think we always needed non-null data for the x_Resources tables.
We may have a few places that still assume you can read it back out (maybe audit?), but we think we can manage those.

@lmsurpre
Copy link
Member Author

this one has wide blast radius...

  1. verify that the x_resources rows for deletes have no resource payload content
  2. "full regression" to make sure things are working as expected, especially after some soft deletes
    • e2e tests (fhir-server-test)
    • touchstone tests

then:
* search performance bucket
* dag/karen have some other local tests including the below

Rough manual test plan:

  • create a resource
  • delete the resource
  • undelete the resource (PUT with same id)
  • delete the resource

Then make sure all the following work:

  • conditional delete
  • if-none-match
  • if-none-match within a bundle
  • $erase
  • $export

@lmsurpre
Copy link
Member Author

lmsurpre commented Mar 1, 2022

I confirmed that the rows in the x_resources table that correspond to deleted versions now have a null data column:
image

and I manually tested re-delete, revive-delete, and conditional delete cases.

@lmsurpre
Copy link
Member Author

lmsurpre commented Mar 1, 2022

I deployed this one to our cluster on IBM Cloud and ran the touchstone conformance tests against it. 100% successful.

@kmbarton423
Copy link
Contributor

confirmed conditional delete is working as expected
did write up an enhancement issue #3419

@kmbarton423
Copy link
Contributor

confirmed if-none-match and if-none-match within a bundle functionality

@kmbarton423
Copy link
Contributor

kmbarton423 commented Mar 7, 2022

confirmed $erase functionality
found issue #3439 during testing but it appears to be unrelated to these changes for soft delete

@lmsurpre
Copy link
Member Author

issue #3439 has been addressed and this feature seems to be working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants