An-DJ commented on issue #8828:
URL: https://github.com/apache/apisix/issues/8828#issuecomment-1427279255

   It seems that this issue cannot be reproduced by myself.
   
   This is my conf like urs:
   ```
   curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
         "plugins": {
               "clickhouse-logger": {
                   "user": "",
                   "password": "",
                   "database": "default",
                   "logtable": "api_log2",
                   "endpoint_addrs": ["http://127.0.0.1:18123";],
                   "batch_max_size": 500,
                   "buffer_duration": 180,
                   "max_retry_count": 5,
                   "retry_delay": 10
               }
          },
         "upstream": {
              "type": "roundrobin",
              "nodes": {
                  "httpbin.org": 1
              }
         },
         "uri": "/demo"
   }'
   ```
   
   A table which schema is like urs:
   ```
   SET allow_experimental_object_type=1; create table api_log2(
     upstream String,
     start_time DateTime64(3, 'Asia/Shanghai'),
     client_ip String,
     service_id String,
     route_id String,
     request JSON,
     response JSON,
     server JSON,
     latency Float64,
     upstream_latency Float64,
     apisix_latency Float64
   )
   ENGINE = MergeTree()
   PARTITION BY toYYYYMM(start_time)
   ORDER BY (start_time, route_id);
   ```
   
   A 404 request:
   ```
   curl "http://localhost:9080/demo"; -I
   HTTP/1.1 404 NOT FOUND
   Content-Type: text/html; charset=utf-8
   Content-Length: 233
   Connection: keep-alive
   Date: Mon, 13 Feb 2023 03:18:29 GMT
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Server: APISIX/3.1.0
   ```
   
   But the log is successfully written into the clickhouse table.
   
   ```
   52.200.117.68:80,2023-02-13T11:18:29.407+08:00,127.0.0.1,"",1,"(('*/*', 
'localhost:9080', 'curl/7.58.0'), 'HEAD', 83, '/demo', 
'http://localhost:9080/demo')","(('true', '*', 'close', '233', 'text/html; 
charset=utf-8', 'Mon, 13 Feb 2023 03:18:29 GMT', 'APISIX/3.1.0'), 242, 
404)","('gpunode2', '3.1.0')",516.00003242493,514,2.0000324249268
   ```
   
   Env:
   * Apache APISIX: 3.1.0
   * Clickhouse: version 22.10.7.13 (official build)


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