ziyanTOP opened a new issue, #32153:
URL: https://github.com/apache/doris/issues/32153

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   2.1.0-rc11-91efb6a
   
   ### What's Wrong?
   
   the built-in audit log plugin will import audit log periodically through 
stream load, with token acquired from master. But when an non-master fe node 
submit audit log stream load, it submits to **itself**, and 
`checkClusterToken()` method will return false due to comparing two different 
token, one from master, the other from **itself**
   
   ```log
   2024-03-13 08:47:29,136 WARN (audit loader thread|60) 
[AuditStreamLoader.loadBatch():150] failed to load audit via AuditLoader plugin 
with label: audit_log_20240313_084729_127_0_0_1_18030
   java.lang.Exception: status is not TEMPORARY_REDIRECT 307, status: 200, 
response: {"msg":"Unauthorized","code":401,"data":"Invalid token: 
12c4cdbc-777f-40c2-92d0-60e2e65382de","count":0}, request is: curl -v -X PUT \
     -H "Authorization":"Basic " \
     -H "Expect":"100-continue" \
     -H "Content-Type":"text/plain; charset=UTF-8" \
     -H "max_filter_ratio":"1.0" \
     -H 
"columns":"query_id,time,client_ip,user,catalog,db,state,error_code,error_message,query_time,scan_bytes,scan_rows,return_rows,stmt_id,is_query,frontend_ip,cpu_time_ms,sql_hash,sql_digest,peak_memory_bytes,workload_group,stmt"
 \
     "http://127.0.0.1:18030/api/__internal_schema/audit_log/_stream_load?";
           at 
org.apache.doris.plugin.audit.AuditStreamLoader.loadBatch(AuditStreamLoader.java:124)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.plugin.audit.AuditLoaderPlugin.loadIfNecessary(AuditLoaderPlugin.java:214)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.plugin.audit.AuditLoaderPlugin.access$300(AuditLoaderPlugin.java:50)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at 
org.apache.doris.plugin.audit.AuditLoaderPlugin$LoadWorker.run(AuditLoaderPlugin.java:255)
 ~[doris-fe.jar:1.2-SNAPSHOT]
           at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_382]
   ```
   
   <br />
   
   code location: `org.apache.doris.plugin.audit.AuditStreamLoader`
   ```java
       public AuditStreamLoader() {
           this.hostPort = "127.0.0.1:" + Config.http_port;
           ...
       }
   ```
   
   ### What You Expected?
   
   non-master fe nodes submit audit log stream load to master
   
   ### How to Reproduce?
   
   send query to an non-master fe node, and check fe.log for code 401
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to