influxdata / influxdata/influxdb-java

The error data blocks the write of normal data

Ouverte
#1,012 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Java
Étoiles
1.2k
Forks
469
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par suivre enableBatch, BatchOptions et les appels à InfluxDB.write dans la reproduction fournie. Examinez comment un point ayant échoué est conservé ou réessayé après l’exécution de exceptionHandler. C’est terminé lorsqu’une écriture ayant échoué, telle que rp_not_exist, n’empêche plus l’écriture des points valides suivants, tout en continuant à signaler l’erreur.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
database
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.