GlenGeng commented on a change in pull request #1504:
URL: https://github.com/apache/ozone/pull/1504#discussion_r524225120



##########
File path: hadoop-hdds/docs/content/design/truncate.md
##########
@@ -0,0 +1,146 @@
+---
+title: Truncate
+summary: Truncate the tail of some key.
+date: 2020-10-16
+jira: HDDS-4239
+status: implementing
+author: runzhiwang
+---
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+
+
+# Abstract
+
+This is a proposal to introduce truncate operation for Ozone, which will allow 
removing data from the tail of a file.
+ 
+The use cases for truncate include
+1. Transaction, journal handling for external systems. Transactions are 
appended to a   Ozone file while they succeed. When a transaction fails it is 
aborted and the file is truncated, which rolls it back to the previous 
successful transaction.

Review comment:
       TransactionLog are usually append only:
   append a pre-write log entry to the TransactionLog when trying to commit a 
transaction, 
   append a commit log entry to the TransactionLog when succeed in committing 
the transaction,
   append a roll-back log entry to the TransactionLog when failed to commit the 
transaction.
   
   The Application Layer will ignore pre-write but roll-back transactins.
   
   I consider we need a better reason for the necessity of implementing 
truncate in Ozone.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to