Most recent measurement is missing in large range

I have a bucket called speed_tests which contains speed_test measurements.

I recorded a recent speed test at 2022-10-18 01:17:28.

I can see the entry when I make the following Flux query.

from(bucket: "speed_tests")
  |> range(start: -40h)
  |> filter(fn: (r) =>
    r._measurement == "speed_test" and
    r._field == "download_bandwidth"
  )

However, when I change the range from -40h to -70h to include past measurements as well as the recent one the most recent one disappears and I’m left with measurements only taken on 2022-10-16.

Why am I not see the measurement also taken on 2022-10-18 when the range is constrained to -70h but do when it’s -40h?

Same issue when using querying with ISO timestamps here’s the raw output from the CLI.

$ influx query 'from(bucket: "speed_tests") |> range(start: 2022-10-17T20:00:00Z) |> filter(fn: (r) => r._measurement == "speed_test" and r._field == "download_bandwidth")' --raw
#group,false,false,true,true,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string
#default,_result,,,,,,,,,,,,,,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,interface_external_ip,interface_internal_ip,interface_is_vpn,interface_mac_addr,interface_name,isp,result_persisted,server_country,server_host,server_id,server_ip,server_location,server_name,server_port,type
,,0,2022-10-17T20:00:00Z,2022-10-19T13:07:45.160447283Z,2022-10-18T00:17:28Z,117867743,download_bandwidth,speed_test,<REDACTED>,<REDACTED>,false,<REDACTED>,eth0,<REDACTED>,true,<REDACTED>,speedtest-lon06.vorboss.net,47230,5.10.145.250,London,Vorboss Limited,8080,result

$ influx query 'from(bucket: "speed_tests") |> range(start: 2022-10-16T20:00:00Z) |> filter(fn: (r) => r._measurement == "speed_test" and r._field == "download_bandwidth")' --raw
#group,false,false,true,true,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string
#default,_result,,,,,,,,,,,,,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,interface_external_ip,interface_internal_ip,interface_is_vpn,interface_mac_addr,interface_name,isp,server_country,server_host,server_id,server_ip,server_location,server_name,server_port,type
,,0,2022-10-16T20:00:00Z,2022-10-19T13:07:50.513518221Z,2022-10-16T20:45:30Z,117383425,download_bandwidth,speed_test,<REDACTED>,<REDACTED>,false,<REDACTED>,eth0,<REDACTED>,<REDACTED>,speedtst1.countybroadband.net,47252,185.164.180.142,Cambridge,County Broadband Ltd,8080,result

Hello @jshbrntt,
What version of InfluxDB are you using?
If you query from
2022-10-18:18:00:00
does that point show up?
Like explicitly use that timestamp?
|> range(start: 2022-10-18:18:00:00 )

I’m using the latest version on Debian 11, installed via apt which was 2.4.0-1.

If I query from |> range(start: 2022-10-18:18:00:00 ) I get no results back as the recent measurement was recorded before that at 2022-10-18T00:17:28Z.

One thing I noticed that was different between the two results is for some reason the newest measurement’s _value had a type of long.

Whereas the older measurement had a type of double.

I ended up writing out all my old data using influxd inspect write and externally transforming it to add u to the end of the field in order to ensure the data was treated as an unsigned int.

After I did this I also updated my speed test script to explicitly treat the measurement as an unsigned int, this appeared to solve my problem.

So is this some kind of undefined behaviour that results when fields are inserted under the same names but different types?