-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add operations for clearing terminology caches #2421
Comments
The terminology subsystem caches terminology resources by URL and/or URL + version. If the user tries to update a CodeSystem or ValueSet resource keeping the same URL + version, the cache does not get cleared and some operations (e.g. validate-code) do not return the expected results after update. This change adds an operation ($clear-cache) that can be called on either terminology resource and will clear the appropriate caches. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>
A potential workaround for this is to do a rolling restart of the fhir-server pods if you really need to clear the caches. |
@lmsurpre the other option we discussed is using the |
The terminology subsystem caches terminology resources by URL and/or URL + version. If the user tries to update a CodeSystem or ValueSet resource keeping the same URL + version, the cache does not get cleared and some operations (e.g. validate-code) do not return the expected results after update. This change adds an operation ($clear-cache) that can be called on either terminology resource and will clear the appropriate caches. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>
* #2421 - Add terminology clear-cache operations The terminology subsystem caches terminology resources by URL and/or URL + version. If the user tries to update a CodeSystem or ValueSet resource keeping the same URL + version, the cache does not get cleared and some operations (e.g. validate-code) do not return the expected results after update. This change adds an operation ($clear-cache) that can be called on either terminology resource and will clear the appropriate caches. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Address test failure due to unexpected test interactions. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Fix issue with operation ordering on clean database All my testing has been done on a dirty database. There are automated build failures that appear to be related to test order and a resource not existing yet on a clean database. Flipping the order of the resource puts and initial clear cache operations so that the resource is guaranteed to be in place. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Address code format issues Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Split term cache operations into a separate module Per discussion with the team, the cache operations are being split into a separate module that will not be included in the default server build. Since it isn't automatically included, the build automation scripts needed to be updated. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Update POM version for new module Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Fix Windows integration, update README Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Apply suggested change Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Apply suggested change Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com> * change package name from javax.json to jakarta.json Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com>
Corey implemented this feature, I've marked as QA |
* #2421 - Add terminology clear-cache operations The terminology subsystem caches terminology resources by URL and/or URL + version. If the user tries to update a CodeSystem or ValueSet resource keeping the same URL + version, the cache does not get cleared and some operations (e.g. validate-code) do not return the expected results after update. This change adds an operation ($clear-cache) that can be called on either terminology resource and will clear the appropriate caches. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Address test failure due to unexpected test interactions. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Fix issue with operation ordering on clean database All my testing has been done on a dirty database. There are automated build failures that appear to be related to test order and a resource not existing yet on a clean database. Flipping the order of the resource puts and initial clear cache operations so that the resource is guaranteed to be in place. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Address code format issues Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Split term cache operations into a separate module Per discussion with the team, the cache operations are being split into a separate module that will not be included in the default server build. Since it isn't automatically included, the build automation scripts needed to be updated. Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Update POM version for new module Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Fix Windows integration, update README Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Apply suggested change Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> * Apply suggested change Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com> * change package name from javax.json to jakarta.json Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com> Co-authored-by: Lee Surprenant <lmsurpre@us.ibm.com>
No further references/Updates, I am closing it as complete. |
Is your feature request related to a problem? Please describe.
The terminology subsystem caches terminology resources (e.g. CodeSystems and ValueSets) such that when a resource change is made to the same URL and version, the resource changes are not immediately reflected in all operation results (e.g. validate-code).
Describe the solution you'd like
I would like for the server to either clear the cache automatically on resource update (difficult to do right now because the cache is not shared between clustered nodes) or provide mechanism through which a client application can clear the cache on demand.
Describe alternatives you've considered
This isn't an issue if the client application does not try to reuse the same URL and version, but that is common at dev time. There is a server flag
fhirServer/term/disableCaching
that was introduced that will disable caching in the terminology subsystem, but is not desirable for a production application. We have a production use case that wants caching, but also wants to be able to clear the cache after updating a single resource url + version.Acceptance Criteria
GIVEN a valueset resource exists
AND the valueset cache has been populated (e.g. $validate-code operation called)
WHEN the valueset resource is updated
AND the clear-cache operation is called on that resource
THEN the next valueset operation returns the correct result for the new resource.
GIVEN a codesystem resource exists
AND the codesystem cache has been populated (e.g. $validate-code operation called)
WHEN the codesystem resource is updated
AND the clear-cache operation is called on that resource
THEN the next codesystem operation returns the correct result for the new resource.
GIVEN an intensional valueset resource exists
AND the codesystem cache has been populated (e.g. ValueSet/xxx/$expand operation called)
WHEN the codesystem resource is updated
AND the clear-cache operation is called on that resource
THEN the next valuset expand operation returns the correct result for the new resource.
Additional Context
It is a known constraint that the FHIR server caches are JVM-local. In the event that a clear-cache operation is needed, the client application will need to call clear-cache on each FHIR server in a cluster.
The text was updated successfully, but these errors were encountered: