-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Brings back support for StringData
in ATS provider
#8965
Conversation
src/Azure/Orleans.Persistence.AzureStorage/Providers/Storage/AzureTableStorageOptions.cs
Outdated
Show resolved
Hide resolved
@@ -202,23 +203,29 @@ private static async Task DoOptimisticUpdate(Func<Task> updateOperation, string | |||
/// </remarks> | |||
internal void ConvertToStorageFormat<T>(T grainState, TableEntity entity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to add a test to check the behavior of the new option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
I'll address both points |
…check if 'UseStringFormat' works correctly.
@benjaminpetit i've addressed both points, sorry for the delay! Have a look at the test specifically the comment I left, let me know if my reasoning makes sense to you. |
@ReubenBond it would be awesome if this could be merged :) |
Currently the Azure Table Storage provider saves the grain state (encoded JSON) but in binary format- Regardless if the orleans serializer or one of the two json serializer are used. And while it can be decoded as UTF-8, its cumbersome to do that when someone wants to manually intervene and change the data in ATS. Let alone just a quick way to simply look at the data.
This PR brings back
StringData
but with the difference that its does NOT useNewtonsoft.Json
to serialize the data as it was previously, but instead uses theGrainStorageSerializer
and converts theBinaryData
to a string format. This allows the data to follow what ever grain storage serializer is configured by the user i.e.: Newtonsoft.Jsonor
System.Text.Json`.AFAIK this is not a breaking change, as we'll continue to read both formats for backwards compatibility.
Microsoft Reviewers: Open in CodeFlow