Giter Club home page Giter Club logo

Comments (13)

mapleFU avatar mapleFU commented on June 10, 2024 1

#2074

Found BitmapString also has this problem 😅 Let me take time to fix it

Oh, it's an expected behavior

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024
  if (start < 0 || stop <= 0 || start >= stop) return rocksdb::Status::OK();

The point maybe the condition above...

from kvrocks.

kay011 avatar kay011 commented on June 10, 2024
if (start < 0) start += static_cast<int64_t>(metadata.size) + 1;
if (stop < 0) stop += static_cast<int64_t>(metadata.size) + 1;
if (stop > static_cast<int64_t>(metadata.size)) stop = static_cast<int64_t>(metadata.size);
if (start < 0 || stop <= 0 || start >= stop) return rocksdb::Status::OK();

I think the code is confused, what is themetadata.sizemeans? the used bytes of bitmap,why should +1 ?

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024

what is themetadata.sizemeans

Means the "extended" bit size. e.g.:

set bit 100 1
--> length = 100
set bit 99 1
--> length = 99
set bit 101 1
--> length = 101

the used bytes of bitmap,why should +1

You can edit it as you'd like 🤔

from kvrocks.

kay011 avatar kay011 commented on June 10, 2024

@mapleFU I do a test, it it not work like you said:
set bit 100 1
--> length = 100
but: length = 13 😄

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024

Yeah, it's bytesize, should contain a mod 8:

  uint32_t byte_index = (offset / 8) % kBitmapSegmentBytes;
  uint64_t used_size = index + byte_index + 1;
  uint64_t bitmap_size = std::max(used_size, metadata.size);

from kvrocks.

jihuayu avatar jihuayu commented on June 10, 2024

Maybe this is the same reason with #1212 (comment)

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024

@kay011 would you like fixing this? If not I'll do a quick fixing

from kvrocks.

kay011 avatar kay011 commented on June 10, 2024

@kay011 would you like fixing this? If not I'll do a quick fixing

you can do it, I will merge your code in my other feature

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024

I'm trying to fix it here: #2069

from kvrocks.

kay011 avatar kay011 commented on June 10, 2024

@mapleFU BITPOS command may be have the same problem, please check~

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024

Sigh, I've checked and also fixed that

from kvrocks.

mapleFU avatar mapleFU commented on June 10, 2024

closed by #2069

from kvrocks.

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.