erratic-pattern commented on code in PR #40243:
URL: https://github.com/apache/arrow/pull/40243#discussion_r1510021392


##########
format/FlightSql.proto:
##########
@@ -1797,6 +1797,15 @@ message DoPutUpdateResult {
   int64 record_count = 1;
 }
 
+// An optional response returned when `DoPut` is called with 
`CommandPreparedStatementQuery`
+message DoPutPreparedStatementResult {
+  option (experimental) = true;
+
+  // (potentially updated) opaque handle for the prepared statement on the 
server.
+  // All subsequent requests for his prepared statement must use this new 
handle, if specified

Review Comment:
   > Do we need to discuss backwards compatibility at all? (Presumably it's on 
the server to detect that the client didn't use the updated handle?)
   
   The only backwards compatibility safeguard in the current proposal is that 
the client must assume the returned handle could be missing if the server is 
following the previous spec. I am open to other suggestions.
   
   What should happen here depends on whether the server is stateful or 
stateless.
   
   *Stateful*: This should be inherently backwards and forwards compatible by 
design. There is no need for an updated handle here, because the server is 
already managing the necessary state. The server can simply execute the 
statement with the original handle, or any updated handle, since it should have 
all the necessary state for the prepared statement. 
   
   *Stateless*: There is no way to properly support prepared statements if the 
client does not return the updated handle. There is no backwards compatibility 
here, and so the only thing to do here is to fail gracefully
   
   It may be worthwhile to document this somewhere, but I'm not sure the best 
place for it.
   
   It would be nice if there could be a way for the server to know whether or 
not a client supports the updated protocol, as that would provide a more 
straightforward path for servers to provide graceful failure. But I'm not sure 
of the best way to do that. There may be implementation-specific tricks 
involving checking a log or a timestamp embedded in the handle to determine if 
a handle was updated but I think that's out of the scope of the spec
   
   



-- 
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]

Reply via email to