Code Monkey home page Code Monkey logo

Comments (1)

artikell avatar artikell commented on July 23, 2024

This bug is due to the fact that the entries_read field should return 0 when it is undetermined. The current lag is determined based on entries_read.
So, there are two situations that we are clear about:

  • s->max_deleted_entry_id <= cg->last_id and cg->last_id <= s.first_id
    • if cg->last_id < s.first_id then cg->entries_read = s->entries_added - s->length;
    • if cg->last_id == s.first_id then cg->entries_read = s->entries_added - s->length - 1;
  • s->max_deleted_entry_id <= cg->last_id and cg->last_id == s->last_id
    • the result is cg->entries_read = s->entries_added
  • otherwise: cg->entries_read = SCG_INVALID_ENTRIES_READ

In native logic, there exists an empty stream logic:

  • s->length == 0 and cg->last_id < s->last_id
    • cg->entries_read = s->entries_added
      This is unreasonable because the current entries_read cannot be the same as entries_added. I suggest that We should remove this.

Based on this conclusion, I will first attempt to submit a PR. Could you please help me check if the conclusion is correct. Or what additional information do I need to provide to help everyone make a judgment. @madolson @stockholmux .tks

from valkey.

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.