Skip to content
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

Test searchv2 #951

Open
roman-khimov opened this issue Feb 14, 2025 · 4 comments · May be fixed by #953
Open

Test searchv2 #951

roman-khimov opened this issue Feb 14, 2025 · 4 comments · May be fixed by #953
Assignees
Labels
feature Completely new functionality I2 Regular impact S4 Routine U1 Critically important to resolve quickly

Comments

@roman-khimov
Copy link
Member

Is your feature request related to a problem? Please describe.

I'm always frustrated when we don't have tests for new features, SearchV2 CLI just went in, so it can be tested with a master (to be 0.45.0) node.

Describe the solution you'd like

We can test the whole searchv2 now. It has a lot of things to consider:

  • attributes (int/non-int)
  • filters (many of them, different types of attributes)
  • returned attributes
  • limits
  • search continuation via token
  • multi-nodeness (try using all nodes for the test container, REP 3 CBF 3 is OK for 4-node setup)

It's somewhat reminiscent of the old search, but still very different in many aspects.

Describe alternatives you've considered

No alternatives.

Additional context

nspcc-dev/neofs-node#3122
https://github.com/nspcc-dev/neofs-api/blob/00bfea07e771ee57f267d2a6387705f300057fea/object/service.proto#L170
https://github.com/nspcc-dev/neofs-api/blob/00bfea07e771ee57f267d2a6387705f300057fea/object/service.proto#L544

@roman-khimov roman-khimov added feature Completely new functionality I2 Regular impact S4 Routine U1 Critically important to resolve quickly labels Feb 14, 2025
@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Feb 14, 2025

@roman-khimov is faster than me 🏎 . Will leave written text here just in case


not yet released, but available starting from nspcc-dev/neofs-node@d50f062. See API docs

summary of innovations:

  • searchv2 CLI command
  • up to 8 filters can be specified
  • up to 8 attributes can be requested
  • matching results are sorted by 1st filtered (and it must be 1st requested) attribute, then by OID when equal. Integers [-115792089237316195423570985008687907853269984665640564039457584007913129639935, 115792089237316195423570985008687907853269984665640564039457584007913129639935] are sorted numerically with GT|GE|LT|LE operands. Otherwise, results are sorted lexicographically (e.g. 1!, 11, 2!, 22)
  • number of matching results are limited by --count flag. Response should not exceed it
  • if there are more than --count matching objects, commands outputs --count items with cursor. Command can be re-executed the same with --cursor flag set to the received cursor: next bunch of objects will come

output example:

$ neofs-cli object searchv2 -r s01.neofs.devenv:8080 -w ../devenv/wallets/wallet.json --cid 8UsLaZTU8JXJyoVGRX1GSSin1n8VvpWgr4ULVwTNrso7 --filters '$Object:creationEpoch GT 0, $Object:objectType EQ REGULAR, .s3-tags-meta-object NOPRESENT, S3-versioning-state NOPRESENT' --attributes 'FileName,$Object:creationEpoch,Timestamp,$Object:payloadLength,$Object:payloadHash'
Enter password > 
Found 2 objects.
4GKT2GZhBnvnhVSpbScaM8W6AujViWY41H6YsNbWEhfb
	FileName: CHANGELOG.md
	$Object:creationEpoch: 97
	Timestamp: 2025-02-14 12:44:11 +0300 MSK
	$Object:payloadLength: 101177
	$Object:payloadHash: f50ed7fd5073e2fa81d690eb037a636da0d035a3a661f1f9cf0d549bfe14d490
6YKWdfTBYuB5FGAMWTkK8YhPH7XzWqNp5LGu3LVE3y3X
	FileName: Makefile
	$Object:creationEpoch: 97
	Timestamp: 2025-02-14 12:44:07 +0300 MSK
	$Object:payloadLength: 4445
	$Object:payloadHash: 6df869ef588044e8ec40b512a24cf01882ffb6edad0dd49bd891036123d27e16

@cthulhu-rider
Copy link
Contributor

@cthulhu-rider
Copy link
Contributor

minor: assert underscored integers dont match NUM* filters nspcc-dev/neofs-node@f7b5c46

@cthulhu-rider
Copy link
Contributor

i also recommend to always add object(s) without filtered attribute for test. This is natural for NOT_PRESENT matcher, but not for the others. For example, will attr NE smth include objects w/o attr? Or how EQ/NE/PREFIX behave w/ empty value?

evgeniiz321 pushed a commit that referenced this issue Feb 19, 2025
closes #951

Signed-off-by: Evgeniy Zayats <[email protected]>
@evgeniiz321 evgeniiz321 linked a pull request Feb 19, 2025 that will close this issue
evgeniiz321 pushed a commit that referenced this issue Feb 19, 2025
closes #951

Signed-off-by: Evgeniy Zayats <[email protected]>
evgeniiz321 pushed a commit that referenced this issue Feb 20, 2025
closes #951

Signed-off-by: Evgeniy Zayats <[email protected]>
evgeniiz321 pushed a commit that referenced this issue Feb 20, 2025
closes #951

Signed-off-by: Evgeniy Zayats <[email protected]>
evgeniiz321 pushed a commit that referenced this issue Feb 20, 2025
closes #951

Signed-off-by: Evgeniy Zayats <[email protected]>
evgeniiz321 pushed a commit that referenced this issue Feb 21, 2025
closes #951

Signed-off-by: Evgeniy Zayats <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality I2 Regular impact S4 Routine U1 Critically important to resolve quickly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants