mchades commented on PR #8336: URL: https://github.com/apache/gravitino/pull/8336#issuecomment-3244037214
> > > > What's the upgrade steps? > > > > > > > > 1. Update the server when enabling compatible > > > > 2. New clients and old clients can access the server at the same time > > > > 3. Remove old clients > > > > 4. Switch off the compatible the feature > > > > > > > > For stage 2, we should handle the new clients and old clients at the same time. Now , we can't handle the new clients and old clients at the same time from the code. > > > > > > > > > Yeah, seems like the step 2 is the problem. For most of the case (no % in the string), encoding once and decoding twice is fine without issue, but we cannot guarantee all the corner cases. > > > > > > We can add a client version to the request header so that the server can identify the client version and no longer needs to rely on the `enableCompatibility` configuration manually. > > What is the behavior if user doesn't specify the client version in the header? Shall we use the new or old API? Normally, it should use the new API, if so, seems we cannot do the backward compatibility (because old client doesn't have the version number in the header). Good question. The key point is that requests from the new and old versions will arrive at the server simultaneously, but the server can only choose one decoding method—either decoding once or twice. After thinking twice, to solve the problem in phase 2, we can add a request header (the client version seems not suitable for this case, we can use for example `X-Query-Parameter-Encoded`), to control the server-side decoding method, and then the behavior becomes: - If the `X-Query-Parameter-Encoded` header does not exist, the decoding method is determined by the server configuration `gravitino.server.api.enableCompatibility` - if `X-Query-Parameter-Encoded=true`, we decode the query parameter **twice** and ignore the server configuration `gravitino.server.api.enableCompatibility` - if `X-Query-Parameter-Encoded=false`, we decode the query parameter **once** and ignore the server configuration `gravitino.server.api.enableCompatibility` - the new version client uses `X-Query-Parameter-Encoded=false` by default in this way, the upgrade steps become: 1. Update the server with a compatible configuration enabled 2. New clients and old clients can access the server simultaneously and will be processed through different methods. 3. Remove old clients 4. Switch off the compatible feature WDYT? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
