Azurite icon indicating copy to clipboard operation
Azurite copied to clipboard

Add Blob Copy & Page Blob support to by SQL based metadata implementation in Blob API and Sync Loki and SQL metadata stores

Open mahmoudbahaa opened this issue 1 year ago • 0 comments

Add Blob Copy & Page Blob support to by SQL based metadata implementation in Blob API. This makes the SQL based metadata implementation in sync with File based one. (issue #2224)

I divided the PR into very small mini commits for better visibility but most of these commits are small either in scope or code.

Changes are as follows:

In code: ([SqlBlobMetadataStore.ts])

  1. Changed properties from separate fields into a single one to allow serializing de-serializing of remaining properties as well.
  2. Added missing await from some async functions in SqlBlobMetadataStore
  3. Ported copyFromURL from Loki to SQL blobMeatadataStore
  4. Ported appendBlock from Loki to SQL blobMeatadataStore
  5. Ported clearRange from Loki to SQL blobMeatadataStore
  6. Ported getPageRanges from Loki to SQL blobMeatadataStore
  7. Ported resizePageBlob from Loki to SQL blobMeatadataStore
  8. Ported updateSequenceNumber from Loki to SQL blobMeatadataStore
  9. Return blobCommittedBlockCount for append blob in getBlobProperties in SQL blobMetadataStore
  10. Check for CopyIfExists condition in startCopyFromURL in SQL blobMetadaStore

In Tests:

  1. Add @sql to all @loki tests
  2. Ignore generateAccountSASQueryParameters in sas blob tests as it depend on timezone and fails even then and test another component not Azurite
  3. Skip production style URL test as it fails in new sdk //To be fixed
  4. Remove skipping of "list uncimmited blob from container" in blob api container test since now it is working
  5. Added await to 2 async functions in 2 tests that was causing these 2 tests to be flaky

Others:

  1. Changed readme and changelog to relfect sync btween Loki and SQL blob metadata stores.

Note: I recommend removing the @loki and @sql all together and run all test cases without grep for both loki and sql to avoid descync in the future but its your call.

mahmoudbahaa avatar Oct 14 '23 07:10 mahmoudbahaa