FHIR icon indicating copy to clipboard operation
FHIR copied to clipboard

Ensure sort is stable

Open lmsurpre opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. In https://github.com/LinuxForHealth/FHIR/issues/3888 we saw some test failures in our sort testing when the server environment started handing out the same lastUpdated time to multiple resources.

Describe the solution you'd like Perform further testing to ensure that our sorts are always stable. If not, this could break our paging.

Describe alternatives you've considered Perform paging using some other approach to ensure stability (e.g. via some variant of https://github.com/LinuxForHealth/FHIR/issues/3476)

Acceptance Criteria

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

Additional context Initial check can be done by looking at our queries (e.g. when _sort=_lastUpdated) and verifying if we have an implicit secondary sort in the query.

lmsurpre avatar Aug 22 '22 13:08 lmsurpre

If we do #3591 then the unstable sort is less concerning because it will at least be consistent across the paged results of a single search.

lmsurpre avatar Sep 20 '22 12:09 lmsurpre