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

Periodic delete #446

Merged
merged 13 commits into from Mar 18, 2024
Merged

Periodic delete #446

merged 13 commits into from Mar 18, 2024

Conversation

Josipmrden
Copy link
Collaborator

@Josipmrden Josipmrden commented Feb 23, 2024

Description

Periodic delete as a workaround for large number of deltas during deletion

Pull request type

  • Bugfix
  • Algorithm/Module
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

######################################

Reviewer checklist (the reviewer checks this part)

Module/Algorithm

######################################

@kgolubic "Added query module for periodic delete of graph entities"
memgraph/documentation#501

@Josipmrden Josipmrden marked this pull request as ready for review March 11, 2024 11:29
@Josipmrden Josipmrden modified the milestones: 1.17.0, 1.16.0 Mar 11, 2024
Copy link
Collaborator

@antepusic antepusic left a comment

Choose a reason for hiding this comment

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

Good job, the query module logic is sound and everything else is fine as well. 👍

I’ve only had a few comments about avoiding duplication, and please add a test where you delete nodes with a specific label (or repurpose test_periodic_delete_on_just_nodes for that

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make batch size-related behavior consistent btwn ValidateBatchSize and ValidateDeletionConfig, and try to extract that into its own function

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: I recommend using positional arguments to avoid repeating, e.g. use
fmt::format("MATCH ({0}) WHERE ID({0}) = __{0}_id", node_name)
instead of
fmt::format("MATCH ({}) WHERE ID({}) = __{}_id", node_name, node_name, node_name) (and ditto elsewhere).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what you mean on the first comment

Copy link
Collaborator

Choose a reason for hiding this comment

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

About the first comment: ValidateBatchSize and ValidateDeletionConfig have different checks & error messages for the batch_size parameter. I advise to make them consistent, and then to extract that into its own function to avoid repeated code.

Copy link
Collaborator

@antoniofilipovic antoniofilipovic left a comment

Choose a reason for hiding this comment

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

Few suggestions, otherwise good work 💪

@Josipmrden
Copy link
Collaborator Author

@antepusic @antoniofilipovic Pls review again!

Copy link
Collaborator

@antepusic antepusic left a comment

Choose a reason for hiding this comment

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

Made the comment in https://github.com/memgraph/mage/pull/446/files#r1521938923 clearer, just make sure to address it

Copy link
Collaborator

@antepusic antepusic left a comment

Choose a reason for hiding this comment

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

I think all’s good now ✔️

Copy link

sonarcloud bot commented Mar 13, 2024

Quality Gate Passed Quality Gate passed

Issues
21 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Josipmrden Josipmrden merged commit e1ce422 into main Mar 18, 2024
9 checks passed
@Josipmrden Josipmrden deleted the periodic-delete branch March 18, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs needed Docs needed feature feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants