-
Notifications
You must be signed in to change notification settings - Fork 251
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
JSON
Column Data Altered During Switchover
#3942
Comments
The bug described here appears to be a result of how JSON data is handled during switchover operations, particularly due to an unintended re-encoding of JSON that alters key order. This causes the API keys to become invalid as any change to the JSON structure, including the order of keys, can lead to a hash mismatch and rejection by the application. Analysis of the Issue
Steps to Reproduce the Issue
SolutionTo ensure the JSON data remains unchanged during switchover operations, the backend should avoid parsing JSON data from the database into a map or struct if order preservation is critical. Instead, it should be copied directly as a Implementation Steps
Expected OutcomeAfter implementing these changes, switchover operations should no longer alter the JSON key order in Additional
|
Describe the Bug:
The data contained within
json
-type columns seems to get altered during a switchover operation. Specifically, the order of keys in the JSON policy column ofgql_api_keys
changes after performing a switchover.Steps to Reproduce:
a25f8082e975812ff5d4b88416768cd931aaa34c
or earlier (usingmake start-swo
)Expected Behaviour:
For
json
-type columns, the data should be preserved exactly during switchover operations. This includes preventing change to the order of keys within the JSON documents stored within these columns.Observed Behavior:
After performing a switchover, the order of keys in the JSON data changes. This suggests that the data might be parsed into a map and then re-encoded, rather than being copied as a
json.RawMessage
.Application Version:
This issue affects all known versions up to and including the commit
a25f8082e975812ff5d4b88416768cd931aaa34c
.Additional Context:
This issue was identified due to GraphQL API keys being rejected following a switchover, as the data alteration resulted in a hash mismatch.
This issue specifically affects the backend.
The text was updated successfully, but these errors were encountered: