924060929 opened a new pull request, #64617:
URL: https://github.com/apache/doris/pull/64617

   ## Proposed changes
   
   The regression test `test_audit_log_hint_session_context` (introduced by 
#64569)
   is flaky: it intermittently fails with `expected: <trace_id:...> but was: 
<null>`.
   
   ### Root cause
   
   The case locates the hint query's audit row with:
   
   ```sql
   select ELEMENT_AT(changed_variables, 'session_context')
   from __internal_schema.audit_log
   where stmt like '%${marker}%' order by time desc limit 1
   ```
   
   That polling query is itself written to the audit log, and its own statement 
text
   also contains `${marker}` (inside the `like` predicate), so its audit row 
matches
   the filter too. The self-row carries no `session_context`, so depending on 
the
   order in which audit rows are flushed, `order by time desc limit 1` can 
return the
   self-row and read a `null` value — which is the observed flakiness.
   
   ### Fix
   
   Locate the row by the marker **and** the exact `session_context` value, so 
the
   `null` self-rows are excluded, then flush and retry until the expected row 
appears.
   
   Introduced by #64569.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to