Merge pull request #2639 from atn34/atn34/include-port-in-address-default
Enable include_port_in_address by default for api version 700
This commit is contained in:
commit
ff44bd2b33
|
@ -51,8 +51,6 @@
|
|||
.. |timeout-database-option| replace:: FIXME
|
||||
.. |causal-read-risky-transaction-option| replace:: FIXME
|
||||
.. |causal-read-risky-database-option| replace:: FIXME
|
||||
.. |include-port-in-address-database-option| replace:: FIXME
|
||||
.. |include-port-in-address-transaction-option| replace:: FIXME
|
||||
.. |transaction-logging-max-field-length-database-option| replace:: FIXME
|
||||
.. |transaction-logging-max-field-length-transaction-option| replace:: FIXME
|
||||
|
||||
|
|
|
@ -329,10 +329,6 @@
|
|||
|
||||
Transactions do not require the strict causal consistency guarantee that FoundationDB provides by default. The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock. Enabling this option is equivalent to calling |causal-read-risky-transaction-option| on each transaction created by this database.
|
||||
|
||||
.. |option-db-include-port-in-address-blurb| replace::
|
||||
|
||||
Addresses returned by get_addresses_for_key include the port when enabled. This will be enabled by default in api version 700, and this option will be deprecated. Enabling this option is equivalent to calling |include-port-in-address-transaction-option| on each transaction created by this database.
|
||||
|
||||
.. |option-db-snapshot-ryw-enable-blurb| replace::
|
||||
|
||||
If this option has been set an equal or more times with this database than the disable option, snapshot reads *will* see the effects of prior writes in the same transaction. Enabling this option is equivalent to calling |snapshot-ryw-enable-transaction-option| on each transaction created by this database.
|
||||
|
@ -372,10 +368,6 @@
|
|||
|
||||
This transaction does not require the strict causal consistency guarantee that FoundationDB provides by default. The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock. One can set this for all transactions by calling |causal-read-risky-database-option|.
|
||||
|
||||
.. |option-include-port-in-address-blurb| replace::
|
||||
|
||||
Addresses returned by get_addresses_for_key include the port when enabled. This will be enabled by default in api version 700, and this option will be deprecated. One can set this for all transactions by calling |include-port-in-address-database-option|.
|
||||
|
||||
.. |option-causal-write-risky-blurb| replace::
|
||||
|
||||
The application either knows that this transaction will be self-conflicting (at least one read overlaps at least one set or clear), or is willing to accept a small risk that the transaction could be committed a second time after its commit apparently succeeds. This option provides a small performance benefit.
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
.. |max-retry-delay-database-option| replace:: :func:`Database.options.set_transaction_max_retry_delay`
|
||||
.. |transaction-size-limit-database-option| replace:: :func:`Database.options.set_transaction_size_limit`
|
||||
.. |causal-read-risky-database-option| replace:: :func:`Database.options.set_transaction_causal_read_risky`
|
||||
.. |include-port-in-address-database-option| replace:: :func:`Database.options.set_transaction_include_port_in_address`
|
||||
.. |transaction-logging-max-field-length-database-option| replace:: :func:`Database.options.set_transaction_logging_max_field_length`
|
||||
.. |snapshot-ryw-enable-database-option| replace:: :func:`Database.options.set_snapshot_ryw_enable`
|
||||
.. |snapshot-ryw-disable-database-option| replace:: :func:`Database.options.set_snapshot_ryw_disable`
|
||||
|
@ -39,7 +38,6 @@
|
|||
.. |snapshot-ryw-enable-transaction-option| replace:: :func:`Transaction.options.set_snapshot_ryw_enable`
|
||||
.. |snapshot-ryw-disable-transaction-option| replace:: :func:`Transaction.options.set_snapshot_ryw_disable`
|
||||
.. |causal-read-risky-transaction-option| replace:: :func:`Transaction.options.set_causal_read_risky`
|
||||
.. |include-port-in-address-transaction-option| replace:: :func:`Transaction.options.set_include_port_in_address`
|
||||
.. |transaction-logging-max-field-length-transaction-option| replace:: :func:`Transaction.options.set_transaction_logging_max_field_length`
|
||||
.. |lazy-iterator-object| replace:: generator
|
||||
.. |key-meth| replace:: :meth:`Subspace.key`
|
||||
|
@ -400,10 +398,6 @@ Database options
|
|||
|
||||
|option-db-causal-read-risky-blurb|
|
||||
|
||||
.. method:: Database.options.set_transaction_include_port_in_address()
|
||||
|
||||
|option-db-include-port-in-address-blurb|
|
||||
|
||||
.. method:: Database.options.set_transaction_logging_max_field_length(size_limit)
|
||||
|
||||
|option-db-tr-transaction-logging-max-field-length-blurb|
|
||||
|
@ -829,10 +823,6 @@ Transaction options
|
|||
|
||||
|option-causal-read-risky-blurb|
|
||||
|
||||
.. method:: Transaction.options.set_include_port_in_address
|
||||
|
||||
|option-include-port-in-address-blurb|
|
||||
|
||||
.. method:: Transaction.options.set_causal_write_risky
|
||||
|
||||
|option-causal-write-risky-blurb|
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
.. |max-retry-delay-database-option| replace:: :meth:`Database.options.set_transaction_max_retry_delay`
|
||||
.. |transaction-size-limit-database-option| replace:: :func:`Database.options.set_transaction_size_limit`
|
||||
.. |causal-read-risky-database-option| replace:: :meth:`Database.options.set_transaction_causal_read_risky`
|
||||
.. |include-port-in-address-database-option| replace:: :meth:`Database.options.set_transaction_include_port_in_address`
|
||||
.. |snapshot-ryw-enable-database-option| replace:: :meth:`Database.options.set_snapshot_ryw_enable`
|
||||
.. |snapshot-ryw-disable-database-option| replace:: :meth:`Database.options.set_snapshot_ryw_disable`
|
||||
.. |transaction-logging-max-field-length-database-option| replace:: :meth:`Database.options.set_transaction_logging_max_field_length`
|
||||
|
@ -37,7 +36,6 @@
|
|||
.. |snapshot-ryw-enable-transaction-option| replace:: :meth:`Transaction.options.set_snapshot_ryw_enable`
|
||||
.. |snapshot-ryw-disable-transaction-option| replace:: :meth:`Transaction.options.set_snapshot_ryw_disable`
|
||||
.. |causal-read-risky-transaction-option| replace:: :meth:`Transaction.options.set_causal_read_risky`
|
||||
.. |include-port-in-address-transaction-option| replace:: :meth:`Transaction.options.set_include_port_in_address`
|
||||
.. |transaction-logging-max-field-length-transaction-option| replace:: :meth:`Transaction.options.set_transaction_logging_max_field_length`
|
||||
.. |lazy-iterator-object| replace:: :class:`Enumerator`
|
||||
.. |key-meth| replace:: :meth:`Subspace.key`
|
||||
|
@ -392,10 +390,6 @@ Database options
|
|||
|
||||
|option-db-causal-read-risky-blurb|
|
||||
|
||||
.. method:: Database.options.set_transaction_include_port_in_address() -> nil
|
||||
|
||||
|option-db-include-port-in-address-blurb|
|
||||
|
||||
.. method:: Database.options.set_transaction_logging_max_field_length(size_limit) -> nil
|
||||
|
||||
|option-db-tr-transaction-logging-max-field-length-blurb|
|
||||
|
@ -771,10 +765,6 @@ Transaction options
|
|||
|
||||
|option-causal-read-risky-blurb|
|
||||
|
||||
.. method:: Transaction.options.set_include_port_in_address() -> nil
|
||||
|
||||
|option-include-port-in-address-blurb|
|
||||
|
||||
.. method:: Transaction.options.set_causal_write_risky() -> nil
|
||||
|
||||
|option-causal-write-risky-blurb|
|
||||
|
|
|
@ -53,8 +53,6 @@
|
|||
.. |timeout-database-option| replace:: FIXME
|
||||
.. |causal-read-risky-database-option| replace:: FIXME
|
||||
.. |causal-read-risky-transaction-option| replace:: FIXME
|
||||
.. |include-port-in-address-database-option| replace:: FIXME
|
||||
.. |include-port-in-address-transaction-option| replace:: FIXME
|
||||
.. |transaction-logging-max-field-length-transaction-option| replace:: FIXME
|
||||
.. |transaction-logging-max-field-length-database-option| replace:: FIXME
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@
|
|||
.. |timeout-database-option| replace:: FIXME
|
||||
.. |causal-read-risky-database-option| replace:: FIXME
|
||||
.. |causal-read-risky-transaction-option| replace:: FIXME
|
||||
.. |include-port-in-address-database-option| replace:: FIXME
|
||||
.. |include-port-in-address-transaction-option| replace:: FIXME
|
||||
.. |transaction-logging-max-field-length-transaction-option| replace:: FIXME
|
||||
.. |transaction-logging-max-field-length-database-option| replace:: FIXME
|
||||
|
||||
|
|
|
@ -2422,6 +2422,9 @@ void TransactionOptions::reset(Database const& cx) {
|
|||
maxBackoff = CLIENT_KNOBS->DEFAULT_MAX_BACKOFF;
|
||||
sizeLimit = CLIENT_KNOBS->TRANSACTION_SIZE_LIMIT;
|
||||
lockAware = cx->lockAware;
|
||||
if (cx->apiVersionAtLeast(700)) {
|
||||
includePort = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Transaction::reset() {
|
||||
|
|
|
@ -172,7 +172,7 @@ description is not currently required but encouraged.
|
|||
description="The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock."
|
||||
defaultFor="20"/>
|
||||
<Option name="transaction_include_port_in_address" code="505"
|
||||
description="Addresses returned by get_addresses_for_key include the port when enabled. This will be enabled by default in api version 700, and this option will be deprecated."
|
||||
description="Addresses returned by get_addresses_for_key include the port when enabled. As of api version 700, this option is enabled by default and setting this has no effect."
|
||||
defaultFor="23"/>
|
||||
</Scope>
|
||||
|
||||
|
@ -183,7 +183,7 @@ description is not currently required but encouraged.
|
|||
description="The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock."/>
|
||||
<Option name="causal_read_disable" code="21" />
|
||||
<Option name="include_port_in_address" code="23"
|
||||
description="Addresses returned by get_addresses_for_key include the port when enabled. This will be enabled by default in api version 700, and this option will be deprecated." />
|
||||
description="Addresses returned by get_addresses_for_key include the port when enabled. As of api version 700, this option is enabled by default and setting this has no effect." />
|
||||
<Option name="next_write_no_write_conflict_range" code="30"
|
||||
description="The next write performed on this transaction will not generate a write conflict range. As a result, other transactions which read the key(s) being modified by the next write will not conflict with this transaction. Care needs to be taken when using this option on a transaction that is shared between multiple threads. When setting this option, write conflict ranges will be disabled on the next write operation, regardless of what thread it is on." />
|
||||
<Option name="commit_on_first_proxy" code="40"
|
||||
|
|
|
@ -151,7 +151,7 @@ struct MemoryLifetime : KVWorkload {
|
|||
wait( delay(0.01) );
|
||||
//we cannot check the contents like other operations so just touch all the values to make sure we dont crash
|
||||
for (int i = 0; i < getAddress_res1.size(); i++) {
|
||||
ASSERT(IPAddress::parse(getAddress_res1[i]).present());
|
||||
ASSERT(NetworkAddress::parseOptional(getAddress_res1[i]).present());
|
||||
}
|
||||
}
|
||||
if(now() - startTime > self->testDuration)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "Arena.h"
|
||||
#include "boost/asio.hpp"
|
||||
|
||||
#include "flow/network.h"
|
||||
|
@ -98,6 +99,15 @@ NetworkAddress NetworkAddress::parse( std::string const& s ) {
|
|||
}
|
||||
}
|
||||
|
||||
Optional<NetworkAddress> NetworkAddress::parseOptional(std::string const& s) {
|
||||
try {
|
||||
return NetworkAddress::parse(s);
|
||||
} catch (Error& e) {
|
||||
ASSERT(e.code() == error_code_connection_string_invalid);
|
||||
return Optional<NetworkAddress>();
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<NetworkAddress> NetworkAddress::parseList( std::string const& addrs ) {
|
||||
// Split addrs on ',' and parse them individually
|
||||
std::vector<NetworkAddress> coord;
|
||||
|
|
|
@ -225,7 +225,8 @@ struct NetworkAddress {
|
|||
bool isTLS() const { return (flags & FLAG_TLS) != 0; }
|
||||
bool isV6() const { return ip.isV6(); }
|
||||
|
||||
static NetworkAddress parse( std::string const& );
|
||||
static NetworkAddress parse(std::string const&); // May throw connection_string_invalid
|
||||
static Optional<NetworkAddress> parseOptional(std::string const&);
|
||||
static std::vector<NetworkAddress> parseList( std::string const& );
|
||||
std::string toString() const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue