influxdata / influxdata/influxdb-java
the WriteApi does not check whether a tag value cotains unauthorized characters ("\n","\r"...)
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 1.2k
- Fork
- 469
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
InfluxDB has some restrictions on tag values : they cannot contain some characters such as: line feed (\n), carriage return (\r). Currently, the Java client library does not check whether values of tags are safe (free of unauthorized characters) before writing them into InfluxDB.
For example, I have a measurement classe called `Temperature`, and it contains a tag field `location`. When I put `location="mad\nrid"` and I write it using `WriteApi`, it will throw the following exception: `partial write: unable to parse 'temperature,location=mad': missing fields dropped=0`. So a partial write will be done in the influxDB database: a new measurement `rid` will be mistakenly created, and it will contain only a part of the write.
If a tag value contains '\r', the java client will not even throw an exception, and it will perform an incorrect write into the database.
I think it would be really useful to add a method that ensures that tag values are correct before sending them to InfluxDB through the line protocol, in order to avoid incorrect writes and anomalous behaviors.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando il percorso di WriteApi che serializza i valori dei tag nel line protocol di InfluxDB. Verifica come vengono gestiti i valori contenenti avanzamento riga e ritorno a capo, quindi aggiungi la validazione affinché i valori non sicuri non possano produrre scritture parziali o errate; usa i test WriteApi esistenti, se presenti, per coprire entrambi i caratteri.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- databases
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100