-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store object metadata in metabases for SearchV2 service #3080
base: master
Are you sure you want to change the base?
Conversation
cthulhu-rider
commented
Jan 13, 2025
•
edited
Loading
edited
- store metadata on Put
- unfiltered
- test scenarios for filtered
- filtered
- attributes
- test sorting
- removal
- migration
9624b00
to
3540889
Compare
f16c1c1
to
8957af6
Compare
) | ||
|
||
var ( | ||
maxUint256 = new(big.Int).SetBytes([]byte{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it 127, 255, 255...
? At least VM has signed 256-bit integers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, https://github.com/holiman/uint256 can be useful here, it's much faster than elastic big.Int
(refs nspcc-dev/neo-go#1581).
metaPrefixA = byte(iota) | ||
metaPrefixBI // integer attributes | ||
metaPrefixBS // all other attributes | ||
metaPrefixC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These better be named semantically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure, will do this finally. But for, now I'm used to naming from the task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
var k []byte | ||
// TODO: move to global funcs | ||
makeKeyB := func(prefix byte, attr string, valLen int) (int, int) { | ||
ln := 1 + oid.Size + len(attr) + valLen + len(utf8Delimiter)*2 // TODO: constantize some stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slices.Concat()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i thought about this. Will make code improvement after functionaly stabilization if u dont mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added key buffering, concatenation does not fit him
c29b7e5
to
00c7b83
Compare
22664c2
to
4bb5abf
Compare
c2c593b
to
0904251
Compare
it seems working except case when primary filtered attribute is not the 1st requested one. Querying the primary attribute is almost always needed, e.g. with NE/PREFIX/NUM filters. It's only redundant with EQ, but for now a primary attribute request can be required. In the future, if the requirement is relaxed, the client's behavior will not be broken and he will be able to slightly optimize the search query i also dont plan to support migration and GC in this PR so to not block testing with fresh storages i need some time to review TODOs, fix linters and beautify the code, but it is rdy overall |
eb9036f
to
871972a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3080 +/- ##
==========================================
+ Coverage 22.47% 22.96% +0.49%
==========================================
Files 751 752 +1
Lines 57804 58387 +583
==========================================
+ Hits 12991 13409 +418
- Misses 43929 44038 +109
- Partials 884 940 +56 ☔ View full report in Codecov by Sentry. |
374e985
to
8dffd53
Compare
There is a need to serve `ObjectService.SearchV2` RPC by the SN. In order not to expand the structure and configuration of the node, the best place to store metadata is metabase. Metabases are extended with per-container object metadata buckets. For each object, following indexes are created: - OID; - attribute->OID; - OID->attribute. Integers are stored specifically to reach lexicographic comparisons without decoding. New `Search` method is provided: it allows to filter out container's objects and receive specified attributes. Count is also limited, op is paged via cursor. In other words, the method follows SearchV2 behavior within single metabase. Refs #3058. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
8dffd53
to
5d513b6
Compare