NSAmelchev opened a new pull request, #13866:
URL: https://github.com/apache/ignite/pull/13866

   ### Problem
   
   `ExecutionServiceImpl.executeFragment` does not send `QueryStartResponse` if 
the first batch of the fragment is
   already sent to the initiator node. The sent batch is registered by 
`Query.onOutboundExchangeStarted`, but on the
   initiator node the query is a `RootQuery`, which overrides this callback 
with a no-op. So a fragment executed on the
   initiator node always sends the response to its own node, which is one more 
task of the query pool per fragment.
   
   The response is redundant there: the first batch received by the initiator 
node calls
   `RootQuery.onInboundExchangeStarted`, which does the same as the response 
handler.
   
   ### Fix
   
   - The no-op override of `RootQuery.onOutboundExchangeStarted` is removed.
   - `Query.initNodeStartedExchanges` is a concurrent set now: fragments of one 
query are executed in different
     threads of the query pool. This is already the case on other nodes, where 
a lost update of the set only led to
     a redundant response.
   
   ### Benchmark
   
   JMH, table `KV (ID INT PRIMARY KEY, VAL VARCHAR)` with 100,000 rows, 1024 
partitions, server nodes in one JVM,
   queries are started from a server node in 1 thread, ARM (Apple Silicon), 
OpenJDK 17.
   
   | Nodes | Query                                | master, ops/s | PR, ops/s | 
Diff   |
   
|-------|--------------------------------------|---------------|-----------|--------|
   | 1     | `SELECT VAL FROM KV WHERE ID = ?`    | 38,226        | 41,623    | 
+8.9 % |
   | 1     | `UPDATE KV SET VAL = ? WHERE ID = ?` | 27,974        | 27,914    | 
0 %    |
   | 2     | `SELECT VAL FROM KV WHERE ID = ?`    | 19,561        | 20,120    | 
+2.9 % |
   
   Allocations per query are the same. With two nodes a half of the queries is 
executed on the other node.
   
   


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