influxdata / influxdata/influxdb-client-csharp

WriteRecordsAsync ignores first one

Open
#546 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
377
Forks
93
Avg merge
9m
Merged PRs (30d)
2

Description

Steps to reproduce:

I would like to write asyncronously a set of records using Line Protocol format.

I'm working with a following dataset:

measurement1,tag1="value1",tag2="value2" field1=110,field2=120,field3=130,field4=140 1673028005
measurement1,tag1="value1",tag2="value2" field1=210,field2=220,field3=230,field4=240 1673028010
measurement1,tag1="value1",tag2="value2" field1=410,field2=420,field3=430,field4=440 1673028015
measurement1,tag1="value1",tag2="value2" field1=610,field2=620,field3=630,field4=640 1673028020
measurement1,tag1="value1",tag2="value2" field1=810,field2=820,field3=830,field4=840 1673028025
measurement1,tag1="value1",tag2="value2" field1=1010,field2=1020,field3=1030,field4=1040 1673028030
measurement1,tag1="value1",tag2="value2" field1=1210,field2=1220,field3=1230,field4=1240 1673028035
measurement1,tag1="value1",tag2="value2" field1=1410,field2=1420,field3=1430,field4=1440 1673028040
measurement1,tag1="value1",tag2="value2" field1=1610,field2=1620,field3=1630,field4=1640 1673028045
measurement1,tag1="value1",tag2="value2" field1=1810,field2=1820,field3=1830,field4=1840 1673028050
measurement1,tag1="value1",tag2="value2" field1=2010,field2=2020,field3=2030,field4=2040 1673028055
measurement1,tag1="value1",tag2="value2" field1=2210,field2=2220,field3=2230,field4=2240 1673028060
measurement1,tag1="value1",tag2="value2" field1=2410,field2=2420,field3=2430,field4=2440 1673028065

And my code is:

        IEnumerable<string[]> batches = CreateBatches(data);
        using InfluxDBClient influxDBClient = new(Options.Host, Options.Token);
        WriteApiAsync writeApiAsync = influxDBClient.GetWriteApiAsync();
        foreach (var records in batches)
        {
            await writeApiAsync.WriteRecordsAsync(records, WritePrecision.S, Options.Bucket, Options.Organization, cancellationToken);
        }

Expected behavior:
I expected all the records to be written but it always ignore the first one.

Actual behavior:
All points except the first one are written.

Specifications:

  • Client Version: 4.12
  • InfluxDB Version: influxdb:2.7.1-alpine docker image
  • Platform: Ubuntu Server 20.04 LTS

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at WriteApiAsync.WriteRecordsAsync and reproduce the report with the supplied 13-record dataset against InfluxDB 2.7.1. Trace the asynchronous write path to determine why the first record is omitted, then verify that all records are written and that the existing batching behavior still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.