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

Fix GEOSEARCH/GEOSEARCHSTORE FROMMEMBER against non existing src key reply #1625

Merged
merged 3 commits into from
Aug 1, 2023

Conversation

enjoy-binbin
Copy link
Member

The new GEOSEARCH and GEOSEARCHSTORE commands was added
in #1533. When typing FROMMEMBER option against non-existing
src key, an IsNotFound error is return and resulting in the
following inconsistency:

127.0.0.1:6666> GEOSEARCH src FROMMEMBER Shenzhen BYBOX 88 88 m
(error) ERR NotFound:
127.0.0.1:6666> GEOSEARCHSTORE dst src FROMMEMBER Shenzhen BYBOX 88 88 m
(error) ERR NotFound:

127.0.0.1:6379> GEOSEARCH src FROMMEMBER Shenzhen BYBOX 88 88 m
(empty array)
127.0.0.1:6379> GEOSEARCHSTORE dst src FROMMEMBER Shenzhen BYBOX 88 88 m
(integer) 0

…reply

The new GEOSEARCH and GEOSEARCHSTORE commands was added
in apache#1533. When typing FROMMEMBER option against non-existing
src key, an IsNotFound error is return and resulting in the
following inconsistency:
```
127.0.0.1:6666> GEOSEARCH src FROMMEMBER Shenzhen BYBOX 88 88 m
(error) ERR NotFound:
127.0.0.1:6666> GEOSEARCHSTORE dst src FROMMEMBER Shenzhen BYBOX 88 88 m
(error) ERR NotFound:

127.0.0.1:6379> GEOSEARCH src FROMMEMBER Shenzhen BYBOX 88 88 m
(empty array)
127.0.0.1:6379> GEOSEARCHSTORE dst src FROMMEMBER Shenzhen BYBOX 88 88 m
(integer) 0
```
torwig
torwig previously approved these changes Jul 31, 2023
Copy link
Contributor

@torwig torwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enjoy-binbin Good catch!

mapleFU
mapleFU previously approved these changes Jul 31, 2023
Copy link
Member

@mapleFU mapleFU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that geo not handle the return value of ZSet::Del(user_key), would this also need to be handled?

@enjoy-binbin
Copy link
Member Author

Seems that geo not handle the return value of ZSet::Del(user_key), would this also need to be handled?

i haven't looked at the store section below yet, just a quick look, looks like it doesn't need it.

@enjoy-binbin enjoy-binbin dismissed stale reviews from mapleFU and torwig via 026f8c2 July 31, 2023 08:41
@git-hulk git-hulk merged commit 35bc983 into apache:unstable Aug 1, 2023
25 checks passed
@enjoy-binbin enjoy-binbin deleted the fix_geosearch_reply branch August 1, 2023 02:15
p1u3o pushed a commit to p1u3o/incubator-kvrocks that referenced this pull request Aug 1, 2023
…reply (apache#1625)

The new GEOSEARCH and GEOSEARCHSTORE commands were added
in apache#1533. When typing the FROMMEMBER option against non-existing
src key, an IsNotFound error is returned and resulting in the
following inconsistency:
```
127.0.0.1:6666> GEOSEARCH src FROMMEMBER Shenzhen BYBOX 88 88 m
(error) ERR NotFound:
127.0.0.1:6666> GEOSEARCHSTORE dst src FROMMEMBER Shenzhen BYBOX 88 88 m
(error) ERR NotFound:

127.0.0.1:6379> GEOSEARCH src FROMMEMBER Shenzhen BYBOX 88 88 m
(empty array)
127.0.0.1:6379> GEOSEARCHSTORE dst src FROMMEMBER Shenzhen BYBOX 88 88 m
(integer) 0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants