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/04/24 23:54:02 UTC
[GitHub] [couchdb] nickva opened a new pull request #2821: Allow specifying FDB transaction options
nickva opened a new pull request #2821:
URL: https://github.com/apache/couchdb/pull/2821
With the latest erlfdb release v1.1.0 we have the ability to set default
transaction options on the database handle. Once set, those are inherited by
every transaction started from that handle.
Use this feature to give advanced users a way to experiment with various
transaction options. Descriptions of those options in the default.ini file have
been mostly a copy and paste from the fdb_c_option.g.h file from the client
library.
In addition, specify some safer default values for transaction timeouts (1min)
and retry limit (100). These quite conservative and are basically something
less that "infinity". In the future these may be adjusted lower.
----------------------------------------------------------------
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
[GitHub] [couchdb] davisp commented on a change in pull request #2821: Allow specifying FDB transaction options
Posted by GitBox <gi...@apache.org>.
davisp commented on a change in pull request #2821:
URL: https://github.com/apache/couchdb/pull/2821#discussion_r415979316
##########
File path: src/fabric/src/fabric2_server.erl
##########
@@ -42,6 +42,21 @@
-define(FDB_DIRECTORY, fdb_directory).
-define(FDB_CLUSTER, fdb_cluster).
-define(DEFAULT_FDB_DIRECTORY, <<"couchdb">>).
+-define(TX_OPTIONS_SECTION, "tx_options").
Review comment:
I'd rename this to be `fdb_tx_options` so that its clear its about the FDB transaction vs something in CouchDB.
##########
File path: src/fabric/src/fabric2_server.erl
##########
@@ -142,3 +170,37 @@ get_env(Key) ->
Value ->
Value
end.
+
+
+apply_tx_options(Db, Cfg) ->
+ maps:map(fun(Option, {Type, Default}) ->
+ case lists:keyfind(atom_to_list(Option), 1, Cfg) of
+ false ->
+ case Default of
+ undefined -> ok;
Review comment:
I think this is wrong. If you change one of these values to a non-default value, then we'd not be able to delete the config entry to revert to a default value. Though I'm wondering what that would be at the C level now that I think about it. Empty string? Or NULL maybe?
----------------------------------------------------------------
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
[GitHub] [couchdb] nickva commented on a change in pull request #2821: Allow specifying FDB transaction options
Posted by GitBox <gi...@apache.org>.
nickva commented on a change in pull request #2821:
URL: https://github.com/apache/couchdb/pull/2821#discussion_r415996159
##########
File path: src/fabric/src/fabric2_server.erl
##########
@@ -142,3 +170,37 @@ get_env(Key) ->
Value ->
Value
end.
+
+
+apply_tx_options(Db, Cfg) ->
+ maps:map(fun(Option, {Type, Default}) ->
+ case lists:keyfind(atom_to_list(Option), 1, Cfg) of
+ false ->
+ case Default of
+ undefined -> ok;
Review comment:
good point, I don't think there is a easy to to reset the option. I wonder if it is safe to just replace the db handle
----------------------------------------------------------------
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
[GitHub] [couchdb] nickva commented on a change in pull request #2821: Allow specifying FDB transaction options
Posted by GitBox <gi...@apache.org>.
nickva commented on a change in pull request #2821:
URL: https://github.com/apache/couchdb/pull/2821#discussion_r415983378
##########
File path: src/fabric/src/fabric2_server.erl
##########
@@ -42,6 +42,21 @@
-define(FDB_DIRECTORY, fdb_directory).
-define(FDB_CLUSTER, fdb_cluster).
-define(DEFAULT_FDB_DIRECTORY, <<"couchdb">>).
+-define(TX_OPTIONS_SECTION, "tx_options").
Review comment:
agree, good idea
----------------------------------------------------------------
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