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

Release 2.5.1 #1622

Merged
merged 17 commits into from
Aug 1, 2023
Merged

Release 2.5.1 #1622

merged 17 commits into from
Aug 1, 2023

Conversation

enjoy-binbin and others added 16 commits July 30, 2023 19:22
The check allow we passing -1 is wrong, without
this fix, passing a -1 will crash the server.
This is a minor fix, SCRIPT EXISTS requires at least
three arguments.

Before the change, we can do this:

```
127.0.0.1:6666> script exists
(empty array)
```

After: we will return the wrong number of arguments error.
The old code called ResetWatchedKeys before the error, and then
ResetWatchedKeys reset the watched_keys_modified flag which causes
the following inconsistencies (with Redis).

kvrocks output:
```
127.0.0.1:6666> watch a
OK
127.0.0.1:6666> watch b     ->>> other client touch a
OK
127.0.0.1:6666> exec
(error) ERR EXEC without MULTI
127.0.0.1:6666> multi
OK
127.0.0.1:6666(TX)> ping
QUEUED
127.0.0.1:6666(TX)> exec
1) PONG
```

redis output:
```
127.0.0.1:6379> watch a
OK
127.0.0.1:6379> watch b     ->>> other client touch a
OK
127.0.0.1:6379> exec
(error) ERR EXEC without MULTI
127.0.0.1:6379> multi
OK
127.0.0.1:6379(TX)> ping
QUEUED
127.0.0.1:6379(TX)> exec
(nil)
````

Introduced in apache#1279
…-existing key (apache#1573)

The current code GETHASH returns an error for a key
that doesn't exist:
```
127.0.0.1:6666> geohash mykey a b c
(error) ERR NotFound:
```

In Redis, this would return:
```
127.0.0.1:6379> geohash mykey a b c
1) (nil)
2) (nil)
3) (nil)
```

GEOPOS also has the same issue, this PR fixes these inconsistencies in this case.
Note that this may break compatibility since in the past
doing: `DECRBY key -9223372036854775808` would succeed
but create an invalid result. And now we will return an
error rejecting the request.

Before:
```
127.0.0.1:6666> set key 0
OK
127.0.0.1:6666> decrby key -9223372036854775807
(integer) 9223372036854775807
127.0.0.1:6666> get key
"9223372036854775807"

127.0.0.1:6666> set key 0
OK
127.0.0.1:6666> decrby key -9223372036854775808
(integer) -9223372036854775808
127.0.0.1:6666> get key
"-9223372036854775808"
```

After:
```
127.0.0.1:6666> decrby key -9223372036854775808
(error) ERR decrement would overflow
```
before:
```
127.0.0.1:6666> zunion 1 zset
(error) ERR wrong number of arguments
```

after:
```
127.0.0.1:6666> zunion 1 zset
(empty array)

127.0.0.1:6666> zunion 1 zset
1) "a"
2) "b"
3) "c"
```
ZRANGESTORE arity should be -5, the code wrongtly sets it to -4,
when passing 4 arguments, server will trigger a Segmentation fault
and result a crash:
```
127.0.0.1:6666> zrangestore dstzset srczset 0
Error: Server closed the connection
not connected>
```
Co-authored-by: git-hulk <hulk.website@gmail.com>
Co-authored-by: Twice <twice@apache.org>
… logs (apache#1556)

This PR has two parts.

The first one, internally, both XREAD and XRANGE call the Stream::Range
function. When Range fails, we should return an error.

The second one is to remove the debug logs. These logs were there in the
earliest days, I guess they are for debugging, remove them now to avoid polluting
the server logs.

The blpop one is easy to reproduce:
```
Failed to execute redis command: blpop, err: Invalid argument: WRONGTYPE
Operation against a key holding the wrong kind of value
```
The name should be used_memory_rss_human according to
the context and Redis documentation.
RocksDB PORTABLE was set to 0 after apache#1516 and it may return an illegal instruction error
when running on the AMD platform. This PR fixes this issue by changing the default value
of PORTABLE to 1 so that it can compile the rocksdb without platform special instructions.
This doesn't matter, just a minor fix, zremrangebyscore
doesn't accept extra arguments.
When the code is doing `store`, it calls the add method,
which leads us to perform zadd dst xxx in disguise. And
this result the following two issues.

The first one is we do a type check against dst:
```
127.0.0.1:6379> set dst value
OK
127.0.0.1:6379> zrangestore dst non 0 -1
(integer) 0
127.0.0.1:6379> get dst
(nil)

127.0.0.1:6666> set dst value
OK
127.0.0.1:6666> zrangestore dst non 0 -1
(error) ERR Invalid argument: WRONGTYPE Operation against a key holding
the wrong kind of value
```

The second one is when dst has members, we are doing zadd:
```
127.0.0.1:6379> zadd dst 1 a 2 b
(integer) 2
127.0.0.1:6379> zadd src 3 c 4 d
(integer) 2
127.0.0.1:6379> zrangestore dst src 0 -1
(integer) 2
127.0.0.1:6379> zrange dst 0 -1
1) "c"
2) "d"

127.0.0.1:6666> zadd dst 1 a 2 b
(integer) 2
127.0.0.1:6666> zadd src 3 c 4 d
(integer) 2
127.0.0.1:6666> zrangestore dst src 0 -1
(integer) 2
127.0.0.1:6666> zrange dst 0 -1
1) "a"
2) "b"
3) "c"
4) "d"
```

ZRANGESTORE was added in apache#1482
Copy link
Contributor

@caipengbo caipengbo left a comment

Choose a reason for hiding this comment

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

LGTM

@PragmaTwice
Copy link
Member

PragmaTwice commented Jul 30, 2023

Seems some fixes are missing:

Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

But generally LGTM.

Copy link
Member

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

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

i see mosts of the commits are mine LOL

@git-hulk
Copy link
Member Author

Seems some fixes are missing:

Yes, I don't bring those two commits since they won't affect users, so maybe we can release them in the next minor release.

@git-hulk
Copy link
Member Author

i see mosts of the commits are mine LOL

I think you're the best bug hunter in our community for sure.

@PragmaTwice
Copy link
Member

Seems that VERSION.txt is not changed.
You can run ./x.py package ... to append a new commit.

@PragmaTwice
Copy link
Member

PragmaTwice commented Jul 30, 2023

And I think squash merge is not a good idea for this PR. But I don't know how to change it.

So maybe you can just push these commits rather than merge the PR.

@git-hulk
Copy link
Member Author

Seems that VERSION.txt is not changed. You can run ./x.py package ... to append a new commit.

Yes, I think we can propose commits and get approved first, then merge them into 2.5 and append the version commit.

@git-hulk
Copy link
Member Author

git-hulk commented Jul 31, 2023

And I think squash merge is not a good idea for this PR. But I don't know how to change it.

So maybe you can just push these commits rather than merge the PR.

ummm... Looks like it has no way to enable the rebase button for some special branches only: https://cwiki.apache.org/confluence/display/INFRA/git+-+.asf.yaml+features#Git.asf.yamlfeatures-Mergebuttons.

Let me pick those commits and push them to 2.5 first, you guys can help to revise them later.

@enjoy-binbin
Copy link
Member

enjoy-binbin commented Jul 31, 2023

in the repo's settings, maybe it is https://github.com/apache/kvrocks/settings
there is a Pull Requests section, we can enable the Allow merge commits
then do a plain merge for this PR (release)
also, we can update the top comment to reflect the changes of this version (somewaht similar to release notes)

i think we've done it pretty well before, like #468

@git-hulk
Copy link
Member Author

@enjoy-binbin The merge/rebase button is controlled by: https://github.com/apache/kvrocks/blob/unstable/.asf.yaml#L32 and it seems no way to open for some branches only.

@enjoy-binbin
Copy link
Member

ohh, in this way, maybe we can also enable the merge button? i think we can go beyond some PRs.
we can control it (when we are doing merge, usually squash is used, and in some cases we need to keep commits we use merge)
that is, the choice of squash or merge is the responsibility of the person for merging the PR

@git-hulk
Copy link
Member Author

git-hulk commented Jul 31, 2023

Yes, I think we can enable the merge button and the merger should know when to use the merge button.

i think we've done it pretty well before, like #468

I will re-edit the PR summary later.

enjoy-binbin added a commit to enjoy-binbin/kvrocks that referenced this pull request Jul 31, 2023
In some cases, such as a release version, we will pick some
commits, then do a PR review, and then merge the commits into
the branch. In this case, we want to use plain merge to keep
the info of each commit instead of using squash-merge.

Or in some refactoring PRs, we can separate code moves (rename)
and actual changes into different commits. These single commits
we want to keep the commit message and doing a plain merge.
In this way, when tracking changes, we can only focus on actual
changes without being affected by meaningless diffs.

When enabled, we can control it (when we are doing merge, usually
squash is used, and in some cases we need to keep commits we use merge).
That is, the choice of squash or merge is the responsibility of the
person for merging the PR.

See apache#1622 for more discussion on release part.
@enjoy-binbin
Copy link
Member

i raise a PR to enable the plain merge in #1624, we can move the discussion there

@enjoy-binbin
Copy link
Member

we need to update the VERSION.txt as well

@git-hulk
Copy link
Member Author

git-hulk commented Aug 1, 2023

we need to update the VERSION.txt as well

@enjoy-binbin Thanks for your warm reminder. The package source will change and change version and I plan to do it when creating the release tarball. But it's also good to append the version change now.

@git-hulk git-hulk merged commit 83eeef4 into apache:2.5 Aug 1, 2023
@enjoy-binbin
Copy link
Member

i see the tag we made is v2.5.1, we used to tag it without v. see https://github.com/apache/kvrocks/releases

but in here it is 2.5.1, so https://github.com/apache/kvrocks/releases/tag/2.5.1 is a 404 link
image

@PragmaTwice
Copy link
Member

PragmaTwice commented Aug 5, 2023

I think it is a bug of GitHub. Our release tag is v2.5.1, and our release note title is 2.5.1.

It is not required to be equal. No problem here for ourselves.

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.

9 participants