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 MERGE] Feature/storage/hns soft delete #17054

Conversation

seanmcc-msft
Copy link
Member

No description provided.

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Nov 18, 2020
@@ -4,7 +4,7 @@
## Configuration
``` yaml
# Generate file storage
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.StorageDataLake/stable/2020-02-10/DataLakeStorage.json
input-file: C:\Users\seanmcc\git\azure-rest-api-specs\specification\storage\data-plane\Microsoft.StorageDataLake\stable\2020-06-12\DataLakeStorage.json
Copy link
Member Author

Choose a reason for hiding this comment

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

I will revert this before merging.

@@ -2,17 +2,17 @@ pushd $PSScriptRoot/Azure.Storage.Common/swagger/Generator/
npm install
npm install -g autorest@beta

cd $PSScriptRoot/Azure.Storage.Blobs/swagger/
autorest --use=$PSScriptRoot/Azure.Storage.Common/swagger/Generator/ --verbose
#cd $PSScriptRoot/Azure.Storage.Blobs/swagger/
Copy link
Member Author

Choose a reason for hiding this comment

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

I will revert this file before merging.

@@ -761,6 +761,195 @@ public virtual DataLakeFileSystemClient GetFileSystemClient(string fileSystemNam
}
#endregion Delete File System

#region Get Service Properties
Copy link
Member Author

Choose a reason for hiding this comment

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

I added DataLakeServiceClient.GetProperties() and .SetProperties() so customers can programmatically enable and disable HNS soft delete using the Data Lake SDK.

Note that DataLakeServiceProperties does not contain StaticWebsite. This is by design, I found during testing that HNS accounts do not support StaticWebsite.

/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual Response<DataLakePathClient> RestorePath(
Copy link
Member Author

Choose a reason for hiding this comment

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

I talked to Kamil, and we chose to go with DataLakeFileSystemClient.RestorePath() for now, instead of .RestoreFile() and .RestoreDirectory.

Also note that this API is on the FileSystemClient. This is because you will be able to rename paths in the future when you restore them. I followed the precedent of BlobServiceClient.RestoreContainer() and ShareServiceClient.RestoreShare().

@@ -2378,5 +2378,241 @@ private void SetNameFieldsIfNull()
return sasUri.ToUri();
}
#endregion

#region Get Deleted Paths
Copy link
Member Author

Choose a reason for hiding this comment

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

Note the limit amount of properties we are returning for the paths in GetDeletedPaths(). I was told by the FE team to try to stick with delete-related properties only.

There are probably a lot of properties we could pull from the swagger here - Azure/azure-rest-api-specs#11741

Copy link
Member Author

Choose a reason for hiding this comment

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

  • Note that I copied BlobContainerClient.GetBlobsHierarchical().
  • GetDeletedPaths() doesn't currently support the delimiter parameter, but it will in the future.
  • I didn't want to create to APIs for GetDeletedPaths(), I thought it was unnecessary.

Assert.AreEqual(1, paths.Count);
Assert.AreEqual($"{directoryName}/{fileName}", paths[0].Path.Name);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

TODO add unit test GetDeletedPathsAsync_PathSize()

/// <summary>
/// The <see cref="GetProperties"/> operation gets the properties
/// of a storage account’s Data Lake service, including properties for
/// Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
Copy link
Contributor

Choose a reason for hiding this comment

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

should this mention retention settings? (and Set as well)

public bool Enabled { get; set; }

/// <summary>
/// Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we shouldn't mention what this setting can affect. I.e. don't mention logging soft-deleted etc. this can be derived from where property of that type is nested.
I made a mistake and read this comment first before realizing that property of this type exists in many places and made me wonder why I'd set soft delete retention in metrics configuration.
Somebody who's full text searching codebase/docs may fall in such trap.
Besides, if this class is used in more places we'd most likely forget to update this doc.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was copied almost exactly from BlobRetentionPolicy.

Comment on lines +42 to +45
/// <summary>
/// The retention policy which determines how long the associated data should persist.
/// </summary>
public DataLakeRetentionPolicy DeleteRetentionPolicy { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

In other places it's easy to figure out what this property mean as they're nested inside some other named part of configuration.
Assuming that this controls how long files/directories exist I think we should be more verbose in naming and doc.
I.e. "The retention policy which determines how long the deleted files and directories should persist."
Maybe this should be called DeletedPathsRetentionPolicy ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This name is pattern-matched from BlobRetentionPolicy.

@seanmcc-msft seanmcc-msft changed the title Feature/storage/hns soft delete [DO NOT MERGE] Feature/storage/hns soft delete Dec 4, 2020
@jsquire
Copy link
Member

jsquire commented Jan 8, 2021

Hi @seanmcc-msft. There hasn't been recent engagement on this PR. Would you please be so kind as to let us know if this is still an active work stream or if the PR should be closed out?

@jsquire jsquire added the no-recent-activity There has been no recent activity on this issue. label Jan 8, 2021
@seanmcc-msft
Copy link
Member Author

@jsquire please leave this open.

@jsquire jsquire removed the no-recent-activity There has been no recent activity on this issue. label Jan 8, 2021
@seanmcc-msft seanmcc-msft deleted the branch Azure:feature/storage/stg76base January 28, 2021 20:05
@seanmcc-msft seanmcc-msft deleted the feature/storage/hnsSoftDelete branch August 17, 2021 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants