You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/03/19 05:46:06 UTC

[GitHub] [couchdb] jiangphcn commented on a change in pull request #2666: [WIP] soft-deletion for database

jiangphcn commented on a change in pull request #2666: [WIP] soft-deletion for database
URL: https://github.com/apache/couchdb/pull/2666#discussion_r394802252
 
 

 ##########
 File path: src/fabric/src/fabric2_fdb.erl
 ##########
 @@ -314,12 +317,65 @@ delete(#{} = Db) ->
     } = ensure_current(Db),
 
     DbKey = erlfdb_tuple:pack({?ALL_DBS, DbName}, LayerPrefix),
-    erlfdb:clear(Tx, DbKey),
-    erlfdb:clear_range_startswith(Tx, DbPrefix),
+    DoRecovery = fabric_util:do_recovery(),
+    case DoRecovery of
+        true ->
+            {Mega, Secs, _} = os:timestamp(),
+            NowSecs = Mega * 1000000 + Secs,
 
 Review comment:
   yes, thanks @nickva for comments.
   
   I changed this locally with 
   ```
               {{Y, Mon, D}, {H, Min, S}} = calendar:universal_time(),
               NowSecs = list_to_binary(lists:flatten(
                   io_lib:format("~w~2.10.0B~2.10.0B."
                   ++ "~2.10.0B~2.10.0B~2.10.0B",
                       [Y, Mon, D, H, Min, S])
               )),
               DeletedDbKey = erlfdb_tuple:pack({?DELETED_DBS, DbName, NowSecs},
                   LayerPrefix),
   ```
   and will push new commit today with other changes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services