Skip to content

Precision not respected when sending LP #382

@bmorris591

Description

@bmorris591

Specifications

  • Client Version: com.influxdb:influxdb3-java:1.9.0
  • InfluxDB Version: influxdb:3-core (Docker)
  • Platform: MacOS 26.3.1 on M2 Max

Code sample to reproduce problem

Point(measurement).apply {
    setTimestamp(date)
}

writePoints(measurements, WriteOptions.Builder().precision(WritePrecision.MS).build())

Expected behavior

When the point is written, the timestamp of the Point is converted to an number at the precision of the WriteOptions from the precision stored on the Point - always NS (NanosecondConverter.convertToNanos(time, precision);)

Actual behavior

There is an error when sending the data

HTTP status code: 400; Message: write buffer error: line protocol parse failed: timestamp, 1778179743159904000, out of range for precision: Millisecond

This is because when the LP is generated the target precision is not passed in

line = ((Point) item).toLineProtocol(null, defaultTags, tagOrder);

As null is passed into WritePrecision no conversion takes place so NS is always sent. This means that the request sends MS as the precision in the query params but sends NS on each LP item.

Additional info

I can't see a workaround

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions