influxdata / influxdata/influxdb-java
the WriteApi does not check whether a tag value cotains unauthorized characters ("\n","\r"...)
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 1.2k
- Forks
- 469
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza rastreando la ruta de WriteApi que serializa los valores de las etiquetas en el protocolo de línea de InfluxDB. Verifica cómo se gestionan los valores que contienen salto de línea y retorno de carro, y luego añade validación para que los valores no seguros no puedan producir escrituras parciales o incorrectas; utiliza las pruebas existentes de WriteApi, si las hay, para cubrir ambos caracteres.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- databases
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100