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

Command Migration: ('HINCRBY', 'HINCRBYFLOAT', 'HRANDFIELD') #1081

Merged
merged 28 commits into from
Oct 20, 2024

Conversation

sashpawar11
Copy link
Contributor

@sashpawar11 sashpawar11 commented Oct 13, 2024

This PR migrates HINCRBY, HINCRBYFLOAT and HRANDFIELD to make it protocol agnostic. Closes #1023

Migration Checklist

  • Migrated the evalXXX function with the latest definition
  • Update or add unit tests for the new implementation.
  • All unit tests pass successfully.
  • Ensure all integration tests pass successfully.
  • Ensure integration tests are added for the migrated command on multi-threaded resp server.
  • Add http, websocket tests for the commands
  • Move Integration tests for the respective commands under the RESP integration tests directory from Async directory
  • Please validate that the documentation for the respective commands is up to date. If not then consider adding them.

Note:

  • Http, Resp and Websocket tests to be added as well since they are missing for the addressed commands under this issue.
  • Docs for these commands have been added

@AshwinKul28 AshwinKul28 added the migration -- command Migrates current eval to a refactored eval for all protocols functionality label Oct 13, 2024
@sashpawar11
Copy link
Contributor Author

Hi @AshwinKul28
update 10/15 - unit tests have been migrated, please have a look and provide feedback! The unit tests have passed succesfully.

Will continue to work on migrating the integration tests.
Thankyou.

@sashpawar11 sashpawar11 marked this pull request as ready for review October 15, 2024 05:18
@sashpawar11
Copy link
Contributor Author

sashpawar11 commented Oct 15, 2024

@AshwinKul28 - the HRANDFIELD command depends on selectRandomFields() for returning the random field.
Should we move it to hash.go which feels more relevant as it has other utility methods around hashmaps?
Currently, selectRandomFields()has been migrated to store_eval.go from eval.go under this PR

@soumya-codes
Copy link
Contributor

soumya-codes commented Oct 15, 2024

@sashpawar11 lets ensure that the corresponding integration tests are migrated as well. cc @AshwinKul28

@sashpawar11
Copy link
Contributor Author

sashpawar11 commented Oct 15, 2024

Hi @AshwinKul28 - for the last task, I'm not sure how to proceed on it.
Are these commands optimized for multi-threaded execution yet?

The unit tests and integration tests have passed in the latest build

@soumya-codes
Copy link
Contributor

@sashpawar11 please refer to existing integration tests under integration_tests/commands/resp for the commands that are already migrated.
We will need to do the same these commands as well.

@sashpawar11
Copy link
Contributor Author

@soumya-codes Awesome, thanks!! Will have a look at it and migrate these commands.
Thankyou

@sashpawar11
Copy link
Contributor Author

sashpawar11 commented Oct 16, 2024

Update 10/16 - added migrated resp tests for the commands. All the tasks have been completed and build passed, however, the http and websocket integration tests are not present for these commands. Added an additional task in the description for the same, will complete it by today/tomorrow and update here once ready for review.

cc @AshwinKul28 @soumya-codes

@sashpawar11
Copy link
Contributor Author

sashpawar11 commented Oct 17, 2024

Update 10/18 - Added all the missing HTTP integrations tests for the command. Will try to complete the web-socket tests asap and mark this PR for review.
cc @AshwinKul28 @soumya-codes

@sashpawar11
Copy link
Contributor Author

Hi @AshwinKul28 @soumya-codes @lucifercr07 - all the commands have been migrated and their respective tests have been added. Resolved multiple merge conflicts along the way.

The PR Is ready for review.

The documentation for the commands are missing and I'll try to add it via a separate PR as this one is already a bit large.
Thankyou.

@sashpawar11
Copy link
Contributor Author

sashpawar11 commented Oct 18, 2024

@AshwinKul28 - the HRANDFIELD command depends on selectRandomFields() for returning the random field. Should we move it to hash.go which feels more relevant as it has other utility methods around hashmaps? Currently, selectRandomFields()has been migrated to store_eval.go from eval.go under this PR

Also, please advise on this.
cc @AshwinKul28 @soumya-codes @lucifercr07

Copy link
Contributor

@lucifercr07 lucifercr07 left a comment

Choose a reason for hiding this comment

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

Can we also check the doc related to 'HINCRBY', 'HINCRBYFLOAT', 'HRANDFIELD' commands also once, if there's any discrepancy?

Minor comments added.

@sashpawar11
Copy link
Contributor Author

Can we also check the doc related to 'HINCRBY', 'HINCRBYFLOAT', 'HRANDFIELD' commands also once, if there's any discrepancy?

Minor comments added.

Hey @lucifercr07 - there no docs present for these commands at the moment. Will be adding them in a seperate pr as I complete working on it.

@sashpawar11
Copy link
Contributor Author

Hi @AshwinKul28 @soumya-codes @lucifercr07 - all the tasks have been completed. Please review the changes!

Latest changes:

  • Documentation for the commands have been added as well.
  • selectrandomfields() has been moved over to hmap.go

@AshwinKul28
Copy link
Contributor

Hey @sashpawar11 this is a commendable effort. Everything looks great to me. Few cosmetic changes are required. (I know this is a little back and forth, apologies for that. But we want to make it a one-time effort, and some ideal PRs to merge)

@sashpawar11
Copy link
Contributor Author

Thanks @AshwinKul28 ! And yes I agree, lets complete all the changes to make this a one-time effort

internal/eval/store_eval.go Show resolved Hide resolved
internal/eval/store_eval.go Show resolved Hide resolved
docs/src/content/docs/commands/HINCRBY.md Show resolved Hide resolved
docs/src/content/docs/commands/HRANDFIELD.md Show resolved Hide resolved
@sashpawar11 sashpawar11 force-pushed the saish-migrate-1023 branch 2 times, most recently from e7d1433 to 39a9a37 Compare October 20, 2024 10:13
@sashpawar11
Copy link
Contributor Author

Conflicts resolved. Ready for merge.
Thankyou

@AshwinKul28 AshwinKul28 merged commit 7747ff1 into DiceDB:master Oct 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration -- command Migrates current eval to a refactored eval for all protocols functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command Migration: ('HINCRBY', 'HINCRBYFLOAT', 'HRANDFIELD')
4 participants