Skip to content

The error data blocks the write of normal data #1012

@zhiwangdu

Description

@zhiwangdu

In the case of enableBatch, errors (for example, no database is specified or an RP is specified incorrectly) will block subsequent normal-point writes, which has a significant impact in low-traffic scenarios.

code like:

        final InfluxDB influxDB = InfluxDBFactory.connect(serverURL, username, password, client, InfluxDB.ResponseFormat.JSON);
        influxDB.setDatabase("db99");
        influxDB.enableBatch(BatchOptions.DEFAULTS.actions(2000).flushDuration(2000).bufferLimit(50000).exceptionHandler(new BiConsumer<Iterable<Point>, Throwable>() {
            @Override
            public void accept(Iterable<Point> points, Throwable throwable) {
                System.out.println(throwable.toString());
            }
        }));
        // error point
        influxDB.write("db99", "rp_not_exist", Point.measurement("testmst").tag("tagk", "abcdd").addField("value", 666).time(Instant.now().toEpochMilli(), TimeUnit.MILLISECONDS).build());
        Thread.sleep(3000);

        // normal point
        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                for (int i = 0; i < 20; i++) {
                    influxDB.write("db99", "autogen", Point.measurement("testmst").tag("tagk", "abcdd").addField("value", 666).time(Instant.now().toEpochMilli(), TimeUnit.MILLISECONDS).build());
                }
            }
        };
        timer.schedule(task, 0, 1000);

influxdb-java keeps trying to write to the wrong point

2025-04-09T07:45:47.786051Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:45:49 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" a7db9961-1516-11f0-9175-fa1641b344d0 81
2025-04-09T07:45:49.813697Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:45:51 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" a910c54d-1516-11f0-9176-fa1641b344d0 108
2025-04-09T07:45:51.839925Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:45:53 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" aa45caee-1516-11f0-9177-fa1641b344d0 83
2025-04-09T07:45:53.865090Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:45:55 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" ab7b1b14-1516-11f0-9178-fa1641b344d0 97
2025-04-09T07:45:55.892218Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:45:57 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" acb039f0-1516-11f0-9179-fa1641b344d0 87
2025-04-09T07:45:57.918067Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:45:59 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" ade5854c-1516-11f0-917a-fa1641b344d0 94
2025-04-09T07:45:59.945061Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:01 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" af1ad2ff-1516-11f0-917b-fa1641b344d0 103
2025-04-09T07:46:01.972132Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:03 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" b05003dc-1516-11f0-917c-fa1641b344d0 137
2025-04-09T07:46:03.998481Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:06 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" b1852e2e-1516-11f0-917d-fa1641b344d0 92
2025-04-09T07:46:06.024571Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:08 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" b2ba5529-1516-11f0-917e-fa1641b344d0 103
2025-04-09T07:46:08.050642Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:10 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" b3ef88fb-1516-11f0-917f-fa1641b344d0 80
2025-04-09T07:46:10.077006Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:12 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" b524c574-1516-11f0-9180-fa1641b344d0 91
2025-04-09T07:46:12.103630Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}
[httpd] 29.5.135.237 - rwuser [09/Apr/2025:15:46:14 +0800] "POST /write?db=db99&rp=rp_not_exist&precision=n&consistency=one HTTP/1.1 " 500 53 "-" "okhttp/4.9.1" b659c320-1516-11f0-9181-fa1641b344d0 111
2025-04-09T07:46:14.128666Z     error   [500] - "retention policy not found: rp_not_exist"      {"log_id": "0vnBIL4l000", "service": "httpd"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions