Skip to content

Conversation

@swamirishi
Copy link
Contributor

@swamirishi swamirishi commented Jul 15, 2024

What changes were proposed in this pull request?

Keys from DeletedTable and DeletedDirTable of AOS should be deleted on batch operation while creating a snapshot and not directly from the table. The transactions have to be flushed to delete the keys. If the transaction is not flushed then the deleted keys wouldn't be present in the next transaction replay leading to having unreferenced blocks in the system.

Scenario:
Snapshot S1 create is fired.
create S1 transaction has not been flushed yet, but it has created the snapshot directory and deleted the entries from the table.
This OM has received a bootstrap request from another OM. The bootstrap command will only copy the OM instance and the snapshots that have been flushed to the AOS. S1 will not be a part of it.
The boostrapped OM will replay unflushed transactions(Create S1 will be a part of it). Now it will create a checkpoint out of the bootstrapped AOS which doesn’t have the delete entries. Now the snapshot instance will also not have the deletedKey entries

What is the link to the Apache JIRA

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

How was this patch tested?

Existing unit tests and addition of unit tests.

…be deleted on batch operation while creating a snapshot

Change-Id: I18b6cba6302cc4690218269e4770ffd62c1a5971
@smengcl
Copy link
Contributor

smengcl commented Jul 16, 2024

Thanks @swamirishi for the patch. The idea makes sense to me. It should have used deleteWithBatch() in the first place.

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 for the patch and good catch @swamirishi

LGTM.

@hemantk-12 hemantk-12 marked this pull request as ready for review July 16, 2024 21:05
@smengcl
Copy link
Contributor

smengcl commented Jul 17, 2024

https://github.com/apache/ozone/actions/runs/9964095152/job/27532079656

Error:  Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 180.071 s <<< FAILURE! - in org.apache.hadoop.ozone.om.snapshot.TestSnapshotBackgroundServices
Error:  org.apache.hadoop.ozone.om.snapshot.TestSnapshotBackgroundServices.testSnapshotAndKeyDeletionBackgroundServices  Time elapsed: 41.556 s  <<< ERROR!
org.apache.ratis.thirdparty.io.grpc.StatusRuntimeException: INTERNAL: Cannot invoke "org.apache.ratis.server.protocol.TermIndex.toProto()" because the return value of "org.apache.ratis.server.raftlog.RaftLog.getTermIndex(long)" is null
	at org.apache.ratis.thirdparty.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
	at org.apache.ratis.thirdparty.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
	at org.apache.ratis.thirdparty.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
	at org.apache.ratis.proto.grpc.AdminProtocolServiceGrpc$AdminProtocolServiceBlockingStub.groupInfo(AdminProtocolServiceGrpc.java:496)
...

@swamirishi swamirishi changed the title HDDS-11183. Keys from DeletedTable and DeletedDirTable of AOS should be deleted on batch operation while creating a snapshot HDDS-11183. Keys from DeletedTable and DeletedDirTable of Active Object Store should be deleted on batch operation while creating a snapshot Jul 18, 2024
@hemantk-12 hemantk-12 merged commit 1996f3a into apache:master Jul 18, 2024
@hemantk-12
Copy link
Contributor

Thanks @swamirishi for the patch and @smengcl for the review.

errose28 added a commit to errose28/ozone that referenced this pull request Jul 30, 2024
…-delete

* HDDS-10239-container-reconciliation: (184 commits)
  HDDS-10373. Implement framework for capturing Merkle Tree Metrics. (apache#6864)
  HDDS-11188. Initial setup for new UI layout and enable users to switch to new UI (apache#6953)
  HDDS-11120. Rich rebalancing status info (apache#6911)
  HDDS-11187. Fix Event Handling in Recon OMDBUpdatesHandler to Prevent ClassCastException. (apache#6950)
  HDDS-11213. Bump commons-daemon to 1.4.0 (apache#6971)
  HDDS-11212. Bump commons-net to 3.11.1 (apache#6973)
  HDDS-11211. Bump assertj-core to 3.26.3 (apache#6972)
  HDDS-11210. Bump log4j2 to 2.23.1 (apache#6970)
  HDDS-11150. Recon Overview page crashes due to failed API Calls (apache#6944)
  HDDS-11183. Keys from DeletedTable and DeletedDirTable of AOS should be deleted on batch operation while creating a snapshot (apache#6946)
  HDDS-11198. Fix Typescript configs for Recon (apache#6961)
  HDDS-11180. Simplify HttpServer2#inferMimeType return statement (apache#6963)
  HDDS-11194. OM missing audit log for upgrade (apache#6958)
  HDDS-10389. Implement a search feature for users to locate open keys within the Open Keys Insights section. (apache#6231)
  HDDS-10561. Dashboard for delete key metrics (apache#6948)
  HDDS-11192. Increase SPNEGO URL test coverage (apache#6956)
  HDDS-11179. DBConfigFromFile#readFromFile result of toIOException not thrown (apache#6957)
  HDDS-11186. First container log missing from bundle (apache#6952)
  HDDS-10844. Clarify snapshot create error message. (apache#6955)
  HDDS-11166. Switch to Rocky Linux-based ozone-runner (apache#6942)
  ...
ptlrs pushed a commit to ptlrs/ozone that referenced this pull request Mar 8, 2025
… AOS should be deleted on batch operation while creating a snapshot (apache#6946)

(cherry picked from commit 1996f3a)
Change-Id: If2fadc0418f920efc97917dcf30668fcd613f4f9
ivandika3 pushed a commit to ivandika3/ozone that referenced this pull request Oct 12, 2025
…be deleted on batch operation while creating a snapshot (apache#6946)

(cherry picked from commit 1996f3a)
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