Giter VIP home page Giter VIP logo

Comments (1)

PeterSzegedi avatar PeterSzegedi commented on June 19, 2024 1

Hi @toni-moreno, @matejzero,

First of all ,thanks for the great implementation, it is very useful for us @toni-moreno.

This issue is stale for quite a while, but I wanted to leave an update since we have ran into the same issue.

The issue is most likely occurs due to a problem with the handleWriteSingle function.
https://github.com/toni-moreno/influxdb-srelay/blob/master/pkg/cluster/influxcluster.go#L168-L178

The function will be called in a loop from a parent function that loops through on all matching routes.

The issue is that:
https://github.com/toni-moreno/influxdb-srelay/blob/master/pkg/cluster/influxcluster.go#L178 will be called twice.

The getBuf() function is doing the following:
c.bufPool.Get().(*bytes.Buffer)

bufPool is:
bufPool sync.Pool

sync.Pool.Get() will result in this:
https://golang.org/pkg/sync/#Pool.Get

As you can see the issue lies here:
Get selects an arbitrary item from the Pool, removes it from the Pool, and returns it to the caller.

The first call will remove the data and the second call will only get an empty result.

The one big HACluster with multiple boxes is working, because it is using the handleWriteHA function, which takes the buffer the same way, but loops through on all endpoints with the same variable inside the same function.
https://github.com/toni-moreno/influxdb-srelay/blob/master/pkg/cluster/influxcluster.go#L221-L254

Could you take a look if I am right?

Many thanks,
Peter

from influxdb-srelay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.