Coder Social home page Coder Social logo

Comments (6)

tsuna avatar tsuna commented on June 2, 2024

I added an integration test to reproduce this problem. Note that shutdown() always calls flush(), and your workaround just happens to work by chance.

The real issue is that flush() kicks off flushBufferedIncrements() but doesn't tie it to the Deferred it returns. So when you .join() on either shutdown() or flush(), the call may return before all the increments are actually flushed to HBase (edit: this is false, see 3 comments below). This is non-trivial to fix due to how the increments get flushed, I'm looking for a solution right now โ€“ the good thing is that there is now a test for this case.

from asynchbase.

tsuna avatar tsuna commented on June 2, 2024

For reference the test case I added is at tsuna/asynchbase@addcea8 โ€“ it wasn't originally supposed to test this bug, but it turns out that it does.

from asynchbase.

shrijeet avatar shrijeet commented on June 2, 2024

๐Ÿ‘ Good stuff tsuna. Glad to see the tests coming through.

from asynchbase.

tsuna avatar tsuna commented on June 2, 2024

OK, so I understand where the problem is. flush() correctly triggers a flush of buffered counter increments, but they aren't tied to the Deferred it returns.

What I said earlier was incorrect: "when you .join() on either shutdown() or flush(), the call may return before all the increments are actually flushed to HBase" โ€“ this is false. shutdown() properly enforces that all in-flight RPCs complete before shutting down.

Really the only issue here is that the way we flush buffered counter increments makes it hard to tie them to a Deferred.

from asynchbase.

tsuna avatar tsuna commented on June 2, 2024

I see how to fix this: we either make flush() wait on all outstanding RPCs, or we add a new public API sync() that does that (that would be analogous to Linux's sync() system call).

I started a discussion on the mailing list asking for input.

Ideally flush() would be able to gain access to the Deferreds of the buffered atomic increments, however due to the way increment coalescing is implemented with a Guava cache, this is rather tricky to implement and I don't see a more elegant solution than the one proposed above.

from asynchbase.

tsuna avatar tsuna commented on June 2, 2024

Have a proposed fix in tsuna/asynchbase@00598d0

from asynchbase.

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.