shuwenwei commented on issue #19178:
URL: https://github.com/apache/iotdb/issues/19178#issuecomment-6737227070

   Thanks for the detailed analysis and reproduction. We agree that allowing 
UDFs in `UPDATE` exposes a broader correctness problem than the missing 
QueryScope alone.
   
   The current schema WAL stores the raw `TableDeviceAttributeUpdateNode` and 
replays it by re-evaluating the UDF expression. This means:
   
   - after `DROP FUNCTION`, or if the UDF jar is missing, replay can fail;
   - if the same function name is re-created with a different implementation, 
replay may silently execute different code;
   - a non-deterministic UDF can produce different values after restart;
   - different replicas may evaluate the same plan differently, so cluster 
availability during replay does not by itself guarantee consistent results.
   
   A snapshot triggered by `DROP FUNCTION` is not a complete fix. It would 
require a cluster-wide barrier, all affected replicas to reach a consistent 
snapshot/log boundary before removing the UDF or jar, and it would still not 
solve non-deterministic re-evaluation while the function remains registered.
   
   For the short term, we plan to reject external UDFs in `UPDATE` assignments 
and predicates at analysis time, while keeping built-in functions and non-UDF 
`UPDATE` statements working. This is intended as a correctness guard rather 
than the final design: supporting UDFs in `UPDATE` later would require 
deterministic, materialized WAL entries containing the actual device/attribute 
changes rather than an expression that must be evaluated again during recovery.
   
   This does not address the remaining non-`UPDATE` paths reported in #19178, 
such as TAG/ATTRIBUTE predicates and `SHOW DEVICES` / `COUNT DEVICES`; those 
need separate IoTDBLocal/context handling. #19107 will remain focused on the 
classloader lifetime problem.
   
   Thanks for offering the jar and script. A minimal reproducer would also be 
useful as a regression case for the rejection behavior.
   


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