nickva commented on a change in pull request #2666: [WIP] soft-deletion for
database
URL: https://github.com/apache/couchdb/pull/2666#discussion_r394813145
##########
File path: src/fabric/src/fabric2_fdb.erl
##########
@@ -172,7 +174,8 @@ create(#{} = Db0, Options) ->
% Eventually DbPrefix will be HCA allocated. For now
% we're just using the DbName so that debugging is easier.
DbKey = erlfdb_tuple:pack({?ALL_DBS, DbName}, LayerPrefix),
- DbPrefix = erlfdb_tuple:pack({?DBS, DbName}, LayerPrefix),
+ #{db_prefix_allocator := DBPrefixAllocator} = erlfdb_directory:root(),
+ DbPrefix = erlfdb_hca:allocate(DBPrefixAllocator, Tx),
Review comment:
We want to generate small prefixes but we also want to keep the data under
the `LayerPrefix` subspace. This might become important for backups and such or
any places where we do range reads over the whole "CouchDB" instances sharing
the same FDB cluster for example.
Then it might be something like
```
AllocPrefix = erlfdb_hca:allocate(Allocator, Tx),
DbPrefix = erlfdb_tuple:pack({?DBS, AllocPrefix}, LayerPrefix)
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services