Update generated.go, and test to keep it up to date

Also remove some unnecessary cgo stuff, and add a description to
trace_partial_file_suffix
This commit is contained in:
Andrew Noyes 2021-12-21 15:16:50 -08:00
parent 6613ec282d
commit fba55557ae
4 changed files with 66 additions and 11 deletions

View File

@ -122,3 +122,11 @@ add_dependencies(directory_go tuple_go)
build_go_package(EXECUTABLE NAME fdb_go_tester PATH _stacktester)
add_dependencies(fdb_go_tester directory_go)
# If this fails, then you need to update bindings/go/src/fdb/generated.go
# Ideally this wouldn't be necessary, but it looks like we distribute the go
# bindings directly from the source on github.
add_test(
NAME update_bindings_go_src_fdb_generated_go
COMMAND ${CMAKE_COMMAND} -E compare_files ${go_options_file} ${CMAKE_CURRENT_SOURCE_DIR}/src/fdb/generated.go
)

View File

@ -22,10 +22,6 @@
package fdb
// #define FDB_API_VERSION 710
// #include <foundationdb/fdb_c.h>
import "C"
// Deprecated: Use OpenDatabase or OpenDefault to obtain a database handle directly.
// Cluster is a handle to a FoundationDB cluster. Cluster is a lightweight
// object that may be efficiently copied, and is safe for concurrent use by

View File

@ -102,6 +102,13 @@ func (o NetworkOptions) SetTraceFileIdentifier(param string) error {
return o.setOpt(36, []byte(param))
}
// Set file suffix for partially written log files.
//
// Parameter: Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension.
func (o NetworkOptions) SetTracePartialFileSuffix(param string) error {
return o.setOpt(39, []byte(param))
}
// Set internal tuning or debugging knobs
//
// Parameter: knob_name=knob_value
@ -271,6 +278,13 @@ func (o NetworkOptions) SetClientBuggifySectionFiredProbability(param int64) err
return o.setOpt(83, int64ToBytes(param))
}
// Set a tracer to run on the client. Should be set to the same value as the tracer set on the server.
//
// Parameter: Distributed tracer type. Choose from none, log_file, or network_lossy
func (o NetworkOptions) SetDistributedClientTracer(param string) error {
return o.setOpt(90, []byte(param))
}
// Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.
//
// Parameter: Max location cache entries
@ -354,6 +368,21 @@ func (o DatabaseOptions) SetTransactionIncludePortInAddress() error {
return o.setOpt(505, nil)
}
// Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. This sets the ``bypass_unreadable`` option of each transaction created by this database. See the transaction option description for more information.
func (o DatabaseOptions) SetTransactionBypassUnreadable() error {
return o.setOpt(700, nil)
}
// Use configuration database.
func (o DatabaseOptions) SetUseConfigDatabase() error {
return o.setOpt(800, nil)
}
// An integer between 0 and 100 (default is 0) expressing the probability that a client will verify it can't read stale data whenever it detects a recovery.
func (o DatabaseOptions) SetTestCausalReadRisky() error {
return o.setOpt(900, nil)
}
// The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault
func (o TransactionOptions) SetCausalWriteRisky() error {
return o.setOpt(10, nil)
@ -379,7 +408,7 @@ func (o TransactionOptions) SetNextWriteNoWriteConflictRange() error {
return o.setOpt(30, nil)
}
// Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction.
// Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction. It is an error to set this option after performing any reads or writes on the transaction.
func (o TransactionOptions) SetReadYourWritesDisable() error {
return o.setOpt(51, nil)
}
@ -533,6 +562,11 @@ func (o TransactionOptions) SetSpecialKeySpaceRelaxed() error {
return o.setOpt(713, nil)
}
// By default, users are not allowed to write to special keys. Enable this option will implicitly enable all options required to achieve the configuration change.
func (o TransactionOptions) SetSpecialKeySpaceEnableWrites() error {
return o.setOpt(714, nil)
}
// Adds a tag to the transaction that can be used to apply manual targeted throttling. At most 5 tags can be set on a transaction.
//
// Parameter: String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.
@ -547,6 +581,23 @@ func (o TransactionOptions) SetAutoThrottleTag(param string) error {
return o.setOpt(801, []byte(param))
}
// Adds a parent to the Span of this transaction. Used for transaction tracing. A span can be identified with any 16 bytes
//
// Parameter: A byte string of length 16 used to associate the span of this transaction with a parent
func (o TransactionOptions) SetSpanParent(param []byte) error {
return o.setOpt(900, param)
}
// Asks storage servers for how many bytes a clear key range contains. Otherwise uses the location cache to roughly estimate this.
func (o TransactionOptions) SetExpensiveClearCostEstimationEnable() error {
return o.setOpt(1000, nil)
}
// Allows ``get`` operations to read from sections of keyspace that have become unreadable because of versionstamp operations. These reads will view versionstamp operations as if they were set operations that did not fill in the versionstamp.
func (o TransactionOptions) SetBypassUnreadable() error {
return o.setOpt(1100, nil)
}
type StreamingMode int
const (
@ -561,13 +612,13 @@ const (
// minimize costs if the client doesn't read the entire range), and as the
// caller iterates over more items in the range larger batches will be
// transferred in order to minimize latency. After enough iterations, the
// iterator mode will eventually reach the same byte limit as ``WANT_ALL``
// iterator mode will eventually reach the same byte limit as “WANT_ALL“
StreamingModeIterator StreamingMode = 0
// Infrequently used. The client has passed a specific row limit and wants
// that many rows delivered in a single batch. Because of iterator operation
// in client drivers make request batches transparent to the user, consider
// ``WANT_ALL`` StreamingMode instead. A row limit must be specified if this
// “WANT_ALL“ StreamingMode instead. A row limit must be specified if this
// mode is used.
StreamingModeExact StreamingMode = 1
@ -684,15 +735,15 @@ type ErrorPredicate int
const (
// Returns ``true`` if the error indicates the operations in the transactions
// Returns “true“ if the error indicates the operations in the transactions
// should be retried because of transient error.
ErrorPredicateRetryable ErrorPredicate = 50000
// Returns ``true`` if the error indicates the transaction may have succeeded,
// Returns “true“ if the error indicates the transaction may have succeeded,
// though not in a way the system can verify.
ErrorPredicateMaybeCommitted ErrorPredicate = 50001
// Returns ``true`` if the error indicates the transaction has not committed,
// Returns “true“ if the error indicates the transaction has not committed,
// though in a way that can be retried.
ErrorPredicateRetryableNotCommitted ErrorPredicate = 50002
)

View File

@ -59,7 +59,7 @@ description is not currently required but encouraged.
description="Once provided, this string will be used to replace the port/PID in the log file names." />
<Option name="trace_partial_file_suffix" code="39"
paramType="String" paramDescription="Append this suffix to partially written log files. When a log file is complete, it is renamed to remove the suffix. No separator is added between the file and the suffix. If you want to add a file extension, you should include the separator - e.g. '.tmp' instead of 'tmp' to add the 'tmp' extension."
description="" />
description="Set file suffix for partially written log files." />
<Option name="knob" code="40"
paramType="String" paramDescription="knob_name=knob_value"
description="Set internal tuning or debugging knobs"/>