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

HDDS-9260. Optimize OmDbInsight API to avoid redundant recursive size calculations for deleted directories during data retrieval. #5265

Closed
wants to merge 3 commits into from

Conversation

ArafatKhan2198
Copy link
Contributor

@ArafatKhan2198 ArafatKhan2198 commented Sep 11, 2023

What changes were proposed in this pull request?

In the current implementation of omdbInsights, the calculation of sizes for deleted directories occurs dynamically when needed. The respective NSSummary object associated with a deleted directory does not retain the directory's size information. Consequently, we must repeatedly traverse the directory structure recursively to calculate its size whenever the omdbInsights endpoint is invoked.

To eliminate the redundancy, we can store the calculated size within the corresponding NSSummary objects. This means that the next time we need to determine the size of a specific deleted directory, we can retrieve the stored size value directly, avoiding the need for recomputation.

It's important to note that this approach is effective for deleted directories, as their size remains constant once they are deleted. Unlike normal directories, where size can change dynamically as files are added or removed, the size of deleted directories remains constant, making it a suitable candidate for this optimization.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9260

How was this patch tested?

Integration Tests

… calculations for deleted directories during data retrieval.
@errose28
Copy link
Contributor

errose28 commented Sep 11, 2023

cc @devmadhuu @dombizita

@ArafatKhan2198
Copy link
Contributor Author

@devmadhuu @sumitagrawl @ashishkumar50 can you please look

Copy link
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

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

@ArafatKhan2198 thanks for working on this patch. LGTM +1

Copy link
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

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

Thanks @ArafatKhan2198 for working on this.

Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

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

@ArafatKhan2198 I have few scenario which seems not handled,

  1. if sub-directory is removed, then the sub-dir size is not removed from parent -- This needs re-calculation again -- This is major issue with this implementation as needs recursive update till its parent
  2. NSSummary when save to DB need extra field also, may not be much problem

@sumitagrawl
Copy link
Contributor

Additionally,

  • deleted directory size is not constant, it keeps changing as files and directory keeps deleting by directoryDeletingService.
  • And NSSUmmary update is not saved to DB also while query update

@sokui sokui mentioned this pull request Dec 11, 2024
@swamirishi swamirishi mentioned this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants