-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
#1018 Migration: Append_GetRange #1095
#1018 Migration: Append_GetRange #1095
Conversation
…ng from the master branch for latest changes
…also removed the custom test executer with the one already present
LGTM |
I need to migrate APPEND too. |
@bhima2001 lets ensure that the corresponding integration tests are migrated as well. cc @AshwinKul28 I have added the checklist to the PR description. Please fill the same. |
…o updated exsisting testcases
Please fix the merge conflicts |
…d websocket context
@JyotinderSingh @benjaminmishra I am not able to identify the reason for why the integration tests are failing. can you please nudge into the right direction. Thanks. |
@bhima2001 I can see at least one test failing may be more. Can I pull you branch to check it out ? |
You are talking about this test case right "FAIL: TestGetSet/GETSET_error_when_key_exists_but_does_not_hold_a_string_value". But this testcase is not failing when i testing it individually/ |
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.
LGTM, minor comment.
…nto migrate-append-getRange
Hey, @soumya-codes I have added docs for both "GETRANGE" and "APPEND" commands using the mentioned format. Please let me know if any further changes need to be made. |
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.
Hi @bhima2001 , Thanks for the changes, Please consider my review comments.
|
||
key := args[0] | ||
obj := store.Get(key) | ||
if obj == nil { |
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.
it looks like we will return "" even if the start and end values are invalid. This is a deviation from the expected behavior for GETRANGE
. Could you please check on this and add this test case in integration and unit tests. Thanks
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.
@apoorvyadav1111 If the start and end are invalid then we throw the following error "ERR value is not an integer or out of range". The above mention case is when an object with the given key is not present in the store
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.
Yes, but even in that case, we must not return a result but an error
} | ||
case object.ObjEncodingInt: | ||
str = strconv.FormatInt(obj.Value.(int64), 10) | ||
default: |
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.
getrange works for other data type such as bytearray as well, please check and update code accordingly. Please add test cases in integration tests and unit tests. Thanks
storedValue, _ = strconv.ParseInt(value, 10, 64) | ||
case object.ObjEncodingEmbStr, object.ObjEncodingRaw: | ||
storedValue = value | ||
default: |
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.
append can also work with other data types such as byte array, please check for others
case object.ObjEncodingEmbStr, object.ObjEncodingRaw: | ||
// If the encoding is a string, retrieve the string value for concatenation | ||
currentValueStr = obj.Value.(string) | ||
default: |
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.
same as above
Hi @bhima2001 , please resolve the conversations that have been addressed and let me know if its ready for review. |
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.
LGTM, Minor doc changes suggested.
@apoorvyadav1111 I would suggest to create a new issue for functionality changes for getrange and assign it to me. Because there are a lot of changes in this PR already and resolving merge conflicts everyday is getting more and more difficult. I would love to pick the code changes issue. |
6671f0b
to
03cacf1
Compare
Hi @bhima2001, please create an issue with the functionalities we discussed and I will assign that to you. Please close that issue on priority. This PR is ready to merge once all comments from @lucifercr07 are addressed. Thanks for taking this humongous task and closing it. |
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.
Please rebase your PR. Changes are approved but cannot merge until conflicts
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.
Hi @bhima2001 , Thank you these changes and addressing all the comments Approving the PR with an additional commit to fix some typos + addressing review from @lucifercr07 .
For Reviewer's Checklist for Migration label PR/Issues
- moved code from eval.go to store_eval.go
- updated cmd meta in eval, worker & server
- moved tests from async to resp
- added/updated tests in http and websocket
- added/updated unit tests in eval folder
- audited documentation and updated as per new standards
- no changes in legacy async code / eval.go file
- rebased with master
- verified the code in local
Thanks
migrated GETRANGE from eval.go to store_eval.go, modified all the test cases. This pr closes #1018