hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.05k stars 1.33k forks source link

Reindex OptimizeStorage with AllVersions not processing all versions using Postgres #6419

Closed mrdnctrk closed 3 weeks ago

mrdnctrk commented 3 weeks ago

When performing a reindex with optimizeStorage set to ALL_VERSIONS on all FHIR resources, data from largeobject to hfj_res_ver is moved for only a subset of versions of the resource instead of all versions.

To Reproduce Steps to reproduce the behavior:

  1. Create a FHIR resource with around 500 versions on an older version of HAPI FHIR like 6.10.5
  2. Migrate db schema to the latest version of HAPI FHIR 7.6
  3. Run $reindex operation with OptimizeStorage set to ALL_VERSIONs

Expected: res_text_vc column populated in hfj_res_ver for all 500 versions of the resource

Actual Outcome: only about 300 versions of the resource has res_text_vc column populated. i.e. not all data moved from largeobject to hfj_res_ver

DB: Postgres