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

[Do not review] Raw resources in the Lake, raw resource separation, history separation, resource id map #4690

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

SergeyGaluzo
Copy link
Contributor

No description provided.

SergeyGaluzo and others added 8 commits September 27, 2024 08:42
* History separation V0

* Forgotten resource

* replace current by view

* TRUNCATE

* HardDelete

* delete history v0

* missed 64 and removed dead code from SQL query generator

* Removed history from current in merge

* Triggers

* tests and tran

* disable/enable indexes

* rollback hard delete and merge

* rollback delete invisible history

* TRUNCATE -> DELETE

* line

* leftovers

* PK check

* Cosmetic

* WHERE nanes

* Get resources with forced indexes

* Removed redundant where

* Adding feature flag for raw resource dedupping

* Enable invisible history by default

* parameters

* commit

* fixed typo

* 65 + more realistic diff

* adjusted update trigger

* right trigger

* next iteration

* special chars

* Added delete and update

* \r

* Adding script runner

* Added verification

* cosmetic

* HOLDLOCK hint

* removed incorrect comments

* RT

* lock timeout

* 180 and remove empty

* no changes in update resource search params

* blob rewriter tool

* Revert "no changes in update resource search params"

This reverts commit b2e0c38.

* comment

* Generic disable indexes and update search params

* Dummy resources

* fixes

* Dummy records based on surr id

* adjust test to filter dummy rows

* exclude history and current

* Adding PerfTest V-1

* Get asyn wrapper without type string to id function

* tool

* not exists on data copy

* packages back

* Added comments.

* Correct filtered index on resource current

* Added redundant IsHistory=0 to index

* deduping

* Removed dummy records

* pp-p

* history clause

* deduping

* testing parameters

* get resource by type and surr id range with many versions

* skip large databases

* Added calls to fhir

* added conflict

* max retries = 3

* database pings

* examples

* reverse

* start closer

* put logic

* Create

* Move 65 to 84

* Fixes after merge

* Adding RawResources table

* change capture tweeks

* Test fix

* Added MI

* inline insert

* Repeat on updates
@SergeyGaluzo SergeyGaluzo requested a review from a team as a code owner October 18, 2024 17:56
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@microsoft microsoft deleted a comment from azure-pipelines bot Oct 18, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Oct 18, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Oct 19, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Oct 19, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Oct 28, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Oct 28, 2024
@microsoft microsoft deleted a comment from azure-pipelines bot Oct 30, 2024
private static string _adlsAccountName;
private static string _adlsAccountKey;
private static Uri _adlsAccountUri;
private static string _adlsAccountManagedIdentityClientId;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field '_adlsAccountManagedIdentityClientId' can be 'readonly'.
private static string _adlsAccountKey;
private static Uri _adlsAccountUri;
private static string _adlsAccountManagedIdentityClientId;
private static BlobContainerClient _adlsClient;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field '_adlsClient' can be 'readonly'.
private static Uri _adlsAccountUri;
private static string _adlsAccountManagedIdentityClientId;
private static BlobContainerClient _adlsClient;
private static bool _adlsIsSet;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field '_adlsIsSet' can be 'readonly'.
{
if (!_adlsIsSet)
{
_adlsAccountName = GetStorageParameter(sqlRetryService, logger, "MergeResources.AdlsAccountName");

Check notice

Code scanning / CodeQL

Static field written by instance method Note

Write to static field from instance method, property, or constructor.
if (!_adlsIsSet)
{
_adlsAccountName = GetStorageParameter(sqlRetryService, logger, "MergeResources.AdlsAccountName");
_adlsConnectionString = GetStorageParameter(sqlRetryService, logger, "MergeResources.AdlsConnectionString");

Check notice

Code scanning / CodeQL

Static field written by instance method Note

Write to static field from instance method, property, or constructor.
}

var db = sqlRetryService.Database.Length < 50 ? sqlRetryService.Database : sqlRetryService.Database.Substring(0, 50);
_adlsContainer = $"fhir-adls-{db.Replace("_", "-", StringComparison.InvariantCultureIgnoreCase).ToLowerInvariant()}";

Check notice

Code scanning / CodeQL

Static field written by instance method Note

Write to static field from instance method, property, or constructor.
var uriStr = GetStorageParameter(sqlRetryService, logger, "MergeResources.AdlsAccountUri");
if (uriStr != null)
{
_adlsAccountUri = new Uri(uriStr);

Check notice

Code scanning / CodeQL

Static field written by instance method Note

Write to static field from instance method, property, or constructor.
if (uriStr != null)
{
_adlsAccountUri = new Uri(uriStr);
_adlsAccountManagedIdentityClientId = GetStorageParameter(sqlRetryService, logger, "MergeResources.AdlsAccountManagedIdentityClientId");

Check notice

Code scanning / CodeQL

Static field written by instance method Note

Write to static field from instance method, property, or constructor.
var bytes = reader.GetSqlBytes(6);
var transactionId = reader.Read(VLatest.Resource.TransactionId, readRequestMethod ? 10 : 9);
var offsetInFile = reader.Read(VLatest.Resource.OffsetInFile, readRequestMethod ? 11 : 10);
var rawResource = ReadRawResource(bytes, decompress, transactionId.Value, offsetInFile);

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
transactionId
may be null at this access because it has a nullable type.
Variable
transactionId
may be null at this access because it has a nullable type.
{
rawResource = new Lazy<string>(_invisibleResource);
// -1 is a temp fix. Remove !!!!!
rawResource = offsetInFile.Value == -1 ? InvisibleResource : GetRawResourceFromAdls(transactionId.Value, offsetInFile.Value).Value;

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
transactionId
may be null at this access because it has a nullable type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant