Skip to content

Conversation

@jojochuang
Copy link
Contributor

Change-Id: I5e2f906508d92c1c21555aa51d9b5c97744f26cd
(cherry picked from commit c1cda1d8e99555282b991f174d0bf597c0deb950)

What changes were proposed in this pull request?

Close RocksDB objects when they are not used.

What is the link to the Apache JIRA

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

How was this patch tested?

This is tested in an internal branch, ran a few workloads.
The RocksDB jar was replaced with a custom build which prints memory leak in stdout. This is the code: https://github.com/jojochuang/rocksdb/commits/debug_memory_leak

With this change, most of the leaks are now gone, except during OM initialization when load DB. Didn't care much about them as they account for very little memory usage.

@jojochuang
Copy link
Contributor Author

om_stdout.log
Sample stdout from OM after this PR.

@kerneltime
Copy link
Contributor

The changes here are in the right direction but this will need to be updated post merge of #3426

Change-Id: Ie63955c03bc2202a352e3e74d8eafe3fdf74fae1

 Conflicts:
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java

Change-Id: I7306e6f224a7ab466cd5b3222d949bd6531ba324
Change-Id: I7bbd272ed5c7ed2fd1328a4189404de9116c699a
Change-Id: Ie4f2aab3f6531da2cb093f8e8086afc483072d1f
@jojochuang jojochuang marked this pull request as ready for review June 17, 2022 05:16
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @jojochuang for working on this.

I found a few more unclosed table iterators in KeyManagerImpl:

TableIterator<String, ? extends Table.KeyValue<String, OmKeyInfo>>
iterator;

TableIterator<String, ? extends Table.KeyValue<String, OmDirectoryInfo>>
iterator = dirTable.iterator();

TableIterator<String, ? extends Table.KeyValue<String, OmDirectoryInfo>>
iterator = dirTable.iterator();

Change-Id: I6088fc7aa1e967d6d59e3ef1c6a697c1d0ae5b39
Change-Id: I99fb164c9e2137db6f52cdcd556a9919222a0252
Change-Id: I0d2a5bf89d56faafaa7948fbeb98db768ab1ada8
Change-Id: I4e477d9ad8eeeda6ecf71f610eb657f394740cfd
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @jojochuang for updating the patch.

@adoroszlai
Copy link
Contributor

@kerneltime would you like to take another look?

@adoroszlai adoroszlai merged commit 179755e into apache:master Jul 2, 2022
@adoroszlai
Copy link
Contributor

Thanks @jojochuang for the patch, @kerneltime for the review.

errose28 added a commit to errose28/ozone that referenced this pull request Jul 12, 2022
* master: (46 commits)
  HDDS-6901. Configure HDDS volume reserved as percentage of the volume space. (apache#3532)
  HDDS-6978. EC: Cleanup RECOVERING container on DN restarts (apache#3585)
  HDDS-6982. EC: Attempt to cleanup the RECOVERING container when reconstruction failed at coordinator. (apache#3583)
  HDDS-6968. Addendum: [Multi-Tenant] Fix USER_MISMATCH error even on correct user. (apache#3578)
  HDDS-6794. EC: Analyze and add putBlock even on non writing node in the case of partial single stripe. (apache#3514)
  HDDS-6900. Propagate TimeoutException for all SCM HA Ratis calls. (apache#3564)
  HDDS-6938. handle NPE when removing prefixAcl (apache#3568)
  HDDS-6960. EC: Implement the Over-replication Handler (apache#3572)
  HDDS-6979. Remove unused plexus dependency declaration (apache#3579)
  HDDS-6957. EC: ReplicationManager - priortise under replicated containers (apache#3574)
  HDDS-6723. Close Rocks objects properly in OzoneManager (apache#3400)
  HDDS-6942. Ozone Buckets/Objects created via S3 should not allow group access (apache#3553)
  HDDS-6965. Increase timeout for basic check (apache#3563)
  HDDS-6969. Add link to compose directory in smoketest README (apache#3567)
  HDDS-6970. EC: Ensure DatanodeAdminMonitor can handle EC containers during decommission (apache#3573)
  HDDS-6977. EC: Remove references to ContainerReplicaPendingOps in TestECContainerReplicaCount (apache#3575)
  HDDS-6217. Cleanup XceiverClientGrpc TODOs, and document how the client works and should be used. (apache#3012)
  HDDS-6773. Cleanup TestRDBTableStore (apache#3434) - fix checkstyle
  HDDS-6773. Cleanup TestRDBTableStore (apache#3434)
  HDDS-6676. KeyValueContainerData#getProtoBufMessage() should set block count (apache#3371)
  ...

Conflicts:
    hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants