Skip to content

Conversation

@rajithaalurims
Copy link
Contributor

Description

A new nullable column DecompressedSize added to Resource table.
A new table type is created to support backward and forward compatibility.
Stored procedures are changed to use data from either old or new data type depending on schema version supported on the instance.

Related issues

Addresses [issue #156583].

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@rajithaalurims rajithaalurims added this to the CY25Q3/2Wk12 milestone Dec 11, 2025
@rajithaalurims rajithaalurims requested a review from a team as a code owner December 11, 2025 19:40
@rajithaalurims rajithaalurims added Enhancement Enhancement on existing functionality. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Schema Version backward compatible labels Dec 11, 2025
@github-actions github-actions bot added the SQL Scripts If SQL scripts are added to the PR label Dec 11, 2025
@SergeyGaluzo
Copy link
Contributor

@rajithaalurims I think this PR is a prerequisite to address issue https://microsofthealth.visualstudio.com/Health/_workitems/edit/156583

,IsRawResourceMetaSet bit NOT NULL
,RequestMethod varchar(10) NULL
,SearchParamHash varchar(64) NULL
,DecompressedLength INT NULL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower case

SergeyGaluzo
SergeyGaluzo previously approved these changes Dec 18, 2025
Parameter table entries:
- FHIR_TotalDataSize: Stores ( total ingested data size + total index size) in GB
- FHIR_TotalIndexSize: Stores total index size in GB
- Both entries include timestamp of last calculation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we rename the entries to FHIR_TotalDataSizeInGB and FHIR_TotalIndexSizeInGB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

### Consequences
- Background job adds periodic database load every 4 hours
- Failure in job does not impact core FHIR server functionality
- Falure in job results in stale data size metrics until next successful run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we would emit failure logs from the background job. Would we need to setup any alerting/monitoring if the background job fails?
Do you think if its useful to add a section for alerts/monitors if needed at all for this design spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. I have added alerting and monitoring in the ADR I put in place on WP side. If there are no metrics being emitted as expected we do get ICMs.

TransactionId bigint NULL,
HistoryTransactionId bigint NULL
HistoryTransactionId bigint NULL,
DecompressedLength int NULL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is nullable for backward compatibility. Do we have a test coverage to ensure we don't pass the null value/0 value for these changes, if it makes sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For iteration1 null and 0 are acceptable. After iteration 2, null values are not acceptable. Once all three iterations are done, we should not have any null values in that table. I can add test coverage in iteration 2 or 3 to make sure there are no null values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Enhancement Enhancement on existing functionality. Schema Version backward compatible SQL Scripts If SQL scripts are added to the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants