Skip to content

Conversation

@ceekay47
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-10206. Expose jmx metrics for snapshot cache size on the ozone manager.

This PR introduces changes to expose snapshot cache size (dbMap.size() in https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java) to the Ozone Manager metrics.

What is the link to the Apache JIRA

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

How was this patch tested?

Workflow run on the fork git repo.

@ceekay47
Copy link
Contributor Author

@swamirishi Can you please review when you have time?

@ceekay47 ceekay47 changed the title Hdds 10206 HDDS-10206. Expose jmx metrics for snapshot cache size on the ozone manager. Jan 31, 2024
@ceekay47
Copy link
Contributor Author

@aswinshakil Can you please take a look when you can?

@adoroszlai
Copy link
Contributor

@ceekay47 please take a look at compile error:

Error:  /home/runner/work/ozone/ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:[859,54] cannot find symbol
Error:    symbol:   method getSnapshotCache()
Error:    location: variable omSnapshotManager of type org.apache.hadoop.ozone.om.OmSnapshotManager
Error:  /home/runner/work/ozone/ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:[89,9] cannot find symbol
Error:    symbol: variable omSnapshotManager
Error:  /home/runner/work/ozone/ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:[109,9] cannot find symbol
Error:    symbol: variable omSnapshotManager
Error:  /home/runner/work/ozone/ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:[162,9] cannot find symbol
Error:    symbol: variable omSnapshotManager
Error:  /home/runner/work/ozone/ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:[235,11] cannot find symbol
Error:    symbol: variable omSnapshotManager

https://github.com/ceekay47/ozone/actions/runs/7883419762/job/21510351002#step:6:2382

@ceekay47
Copy link
Contributor Author

@adoroszlai Thanks for taking a look. Fixed and updated the PR.

@swamirishi swamirishi added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Mar 26, 2024
Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @ceekay47 for the patch.

I don't think it is a good idea to update metrics like this. It would be better if you increment and decrement the snapshotCacheSize metric whenever you open a new rocksDB instance and close it respectively inside the SnapshotCache.

Copy link
Contributor

@swamirishi swamirishi left a comment

Choose a reason for hiding this comment

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

@ceekay47 Thanks for the patch I had some nitpicky comments otherwise the patch looks good.

@ceekay47
Copy link
Contributor Author

ceekay47 commented Apr 2, 2024

@hemantk-12 @swamirishi Thanks for the review.

I have addressed the review comments. Can you take a look? Thanks.

Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @ceekay47 for addressing the comments.

Left a comment about updating tests to validate metrics and a minor comment about removing the white line. Otherwise, change looks good to me.

@ceekay47
Copy link
Contributor Author

ceekay47 commented Apr 4, 2024

@hemantk-12 Thanks again for the review. I've added validation for the metric in tests.

@ceekay47 ceekay47 requested a review from hemantk-12 April 4, 2024 08:04
Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @ceekay47 for working on this.

LGTM.

Copy link
Contributor

@swamirishi swamirishi left a comment

Choose a reason for hiding this comment

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

Thanks for the patch @ceekay47 LGTM

@swamirishi swamirishi merged commit 301664e into apache:master Apr 5, 2024
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request May 29, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 18, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 18, 2024
swamirishi pushed a commit to swamirishi/ozone that referenced this pull request Dec 3, 2025
… the ozone manager. (apache#6138)

Change-Id: I511df57abdc7c2e1392d849530116786ea3dc647
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metrics snapshot https://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants