1959 Commits

Author SHA1 Message Date
Evan Tschannen
b1935f1738 fix: do not allow a storage server to be removed within 5 million versions of it being added, because if a storage server is added and removed within the known committed version and recovery version, they storage server will need see either the add or remove when it peeks 2018-05-05 18:16:28 -07:00
Evan Tschannen
8371afb565 fix: log routers need to know if the log system is stopped to determine how they should peek the last log generation 2018-05-05 17:56:00 -07:00
Evan Tschannen
7ed64c821e fix: recruiting a cluster controller takes longer after restarting tests because we wait until files have recovered from disk before starting 2018-05-05 17:20:48 -07:00
Evan Tschannen
e8ea02e054 fix: storage servers need to fail if they can no longer peek data 2018-05-05 17:19:59 -07:00
Julien Blache
029373835c Cleanup CGO_*FLAGS
Use CGO_CPPFLAGS, remove non-ld options from CGO_LDFLAGS.
2018-05-04 19:15:48 -07:00
Evan Tschannen
2e41cea6dc
Merge pull request #303 from ajbeamon/read-bytes-and-keys-in-status
Add read bytes and read keys info to status.
2018-05-04 13:18:39 -07:00
A.J. Beamon
432a295bc2 Add read bytes and read keys info to status. Collect this information directly from StorageMetrics rather than through ratekeeper. 2018-05-04 12:01:40 -07:00
Alec Grieser
2c9f49d713
Merge pull request #299 from ajbeamon/release-5.1
fdb_c test fixes
2018-05-04 09:33:30 -07:00
A.J. Beamon
6502d790b9 Remove extra call to create transaction. Cleanup created transactions. 2018-05-04 09:06:47 -07:00
A.J. Beamon
d5f69ff596
Merge pull request #296 from apple/release-5.1
Merge Release 5.1 Into Release 5.2
2018-05-03 12:05:35 -07:00
Steve Atherton
dadbc26929
Merge pull request #295 from yichic/abort-backup-get-tag
Abort backup get tag
2018-05-03 11:48:59 -07:00
Yichi Chiang
c37b48308e Fix the way to get tagName 2018-05-03 11:11:44 -07:00
Alec Grieser
0cb5791e28
Merge pull request #293 from brownleej/fdb-c-download-fix
Fixes the links to download the client libraries in our documentation and packages.
2018-05-02 13:50:00 -07:00
Evan Tschannen
440e2ae609 fix: data distribution logic was incorrect for finding a complete source team in a failed DC 2018-05-01 23:08:31 -07:00
Evan Tschannen
87ad03ce53 locality aware load balancing was disabled on the storage servers because emergency teams might cause a server to be assigned a shard when it does not actually have the data. This problem has been fixed, so we can re-enable locality aware load balancing. 2018-05-01 22:45:22 -07:00
Evan Tschannen
b4bd03e67e fix: we cannot set queueCommitEnd until we have popped the log system to prevent the popped version from going backwards 2018-05-01 22:20:25 -07:00
Evan Tschannen
12ef63b698 knobify replace contents bytes 2018-05-01 19:43:35 -07:00
John Brownlee
1739c82c1b Fixes the links to download the client libraries in our documentation and packages. 2018-05-01 16:10:51 -07:00
Steve Atherton
e5320fa237
Merge pull request #292 from ajbeamon/printable-encode-backup-beginfile
Encode BeginFile TraceEvent detail with printable
2018-05-01 15:53:48 -07:00
Alec Grieser
8c47e0a086
Merge pull request #278 from vmg/vmg/tuple
bindings/go: Reduce memory allocations when packing tuples
2018-05-01 15:46:20 -07:00
Evan Tschannen
6aba95356e
Merge pull request #291 from yichic/abort-5.1-backup
Abort 5.1 backup for 5.2 upgrade
2018-05-01 15:36:02 -07:00
A.J. Beamon
f848c68b73 TraceEvents in FileBackupAgent that include BeginFile should be encoding them with printable because of the possible inclusion of the null byte. This causes the detail to terminate prematurely. 2018-05-01 15:35:48 -07:00
Evan Tschannen
656a817e74 fix: only reconfigure during the quiet database check, because excluding at the same time as reconfiguring causes the master to indefinitely restart recovery 2018-05-01 15:31:49 -07:00
Yichi Chiang
52cc592d5e Abort 5.1 backup for 5.2 upgrade 2018-05-01 14:49:14 -07:00
Evan Tschannen
c3f2e2bb38 fix: do not attempt to become the cluster controller before recovering files from disk 2018-05-01 12:05:43 -07:00
Alec Grieser
1eea57c5fa
Merge pull request #288 from ajbeamon/release-5.2
Add comment explaining synchronization behavior in high contention allocator
2018-05-01 11:15:14 -07:00
A.J. Beamon
060b655257
Add another line of description to synchronization comment. 2018-05-01 10:00:49 -07:00
Alec Grieser
90069f25f8
Merge pull request #289 from ajbeamon/release-5.1
cherry pick: Fix `undefined: e` in a code snippet
2018-05-01 09:58:49 -07:00
Hiroshi Saito
5ff2d73f84 Fix undefined: e in a code snippet 2018-05-01 09:34:51 -07:00
A.J. Beamon
a8c083509c Add a note about why the high-contention allocator synchronizes on HighContentionAllocator.class rather than Transaction. 2018-05-01 09:31:40 -07:00
A.J. Beamon
27fab38b87
Merge pull request #286 from hiroshi/patch-1
Fix `undefined: e` in a code snippet of class-scheduling-go document
2018-05-01 08:10:43 -07:00
Vicent Marti
a19af9921e bindings/go: Reduce memory allocations when packing tuples
Memory profiling a FoundationDB layer implemented in Go shows high
memory pressure and increased GC times when performing highly-concurrent
multi-key transactions on the database. Further digging displays that
the source of the memory pressure happens when packing the keys for the
transaction into byte slices: the most salient issue is that memory
during the packing process is allocated based on the number of elements
to pack and not on the total size of the resulting byte slice.

This commit attempts to reduce the amount of memory allocated when
calling `Tuple.Pack` for most (all?) usage patterns, both in number of
allocations and in total allocated size.

The following optimizations have been implemented:

- Remove `bytes.Buffer` usage in `encodeTuple`: the `Buffer` struct is
quite expensive for the key sizes we're looking to generate, both
allocation and performance-wise. A `packer` struct has been implemented
that builds the keys "naively" by using `append` on a slice. Slice
growth in Go is also amortized just like in `bytes.Buffer`.

- Do not use `bytes.Replace` in `encodeBytes`: this function is
particularly expensive because it always allocates a copy of the byte
slice, even when it doesn't contain nil bytes. Instead, the replacement
step has been implemented manually in `packer.putbytesNil`, where it can
perform the replacement optimally into the output byte slice without
allocating memory. By having this local function we also allow the
compiler to not duplicate any input `string`s when casting them to
`[]byte`; previously, a copy of every string to pack was always being
allocated because the compiler couldn't prove that `bytes.Replace`
wouldn't modify the slice.

- Use stack space in `encode[Float|Double|Int]`: all the numerical
packing functions were allocating huge amounts of memory because of the
usage of temporary `bytes.Buffer` objects and `binary.Write` calls. The
sizes for all the packed data are always known (either 4 or 8 bytes
depending on type), so the big endian packing can be performed directly
on the stack with `binary.BigEndian.PutUint[32|64]`, which doesn't
require the `interface{}` conversion for the `binary.Write` API and in
x64 compiles to a `mov + bswap` instruction pair.

As a result of these optimizations, the "average" case of key packing
can now create a key with a single allocation.  More complex key packing
operations, even those that contain strings/byte slices with nil bytes,
now allocate memory in a constant way (i.e. amortized based on the
amount of growth of the output buffer and not the number of Tuple
elements to pack).

Additionally, the reduction of memory allocations and the better usage
of the `binary` APIs produce a very significant reduction in runtime for
key packing: between 2x and 6x faster for all packing operations.

Before/after benchmarks are as follows:

benchmark                                  old ns/op     new ns/op     delta
BenchmarkTuplePacking/Simple-4             310           76.4          -75.35%
BenchmarkTuplePacking/Namespaces-4         495           137           -72.32%
BenchmarkTuplePacking/ManyStrings-4        960           255           -73.44%
BenchmarkTuplePacking/ManyStringsNil-4     1090          392           -64.04%
BenchmarkTuplePacking/ManyBytes-4          1409          399           -71.68%
BenchmarkTuplePacking/ManyBytesNil-4       1364          533           -60.92%
BenchmarkTuplePacking/LargeBytes-4         319           107           -66.46%
BenchmarkTuplePacking/LargeBytesNil-4      638           306           -52.04%
BenchmarkTuplePacking/Integers-4           2764          455           -83.54%
BenchmarkTuplePacking/Floats-4             3478          482           -86.14%
BenchmarkTuplePacking/Doubles-4            3654          575           -84.26%
BenchmarkTuplePacking/UUIDs-4              366           211           -42.35%

benchmark                                  old allocs     new allocs     delta
BenchmarkTuplePacking/Simple-4             6              1              -83.33%
BenchmarkTuplePacking/Namespaces-4         11             1              -90.91%
BenchmarkTuplePacking/ManyStrings-4        18             2              -88.89%
BenchmarkTuplePacking/ManyStringsNil-4     18             2              -88.89%
BenchmarkTuplePacking/ManyBytes-4          23             3              -86.96%
BenchmarkTuplePacking/ManyBytesNil-4       22             2              -90.91%
BenchmarkTuplePacking/LargeBytes-4         3              2              -33.33%
BenchmarkTuplePacking/LargeBytesNil-4      3              2              -33.33%
BenchmarkTuplePacking/Integers-4           63             3              -95.24%
BenchmarkTuplePacking/Floats-4             62             2              -96.77%
BenchmarkTuplePacking/Doubles-4            63             3              -95.24%
BenchmarkTuplePacking/UUIDs-4              2              2              +0.00%

benchmark                                  old bytes     new bytes     delta
BenchmarkTuplePacking/Simple-4             272           64            -76.47%
BenchmarkTuplePacking/Namespaces-4         208           64            -69.23%
BenchmarkTuplePacking/ManyStrings-4        512           192           -62.50%
BenchmarkTuplePacking/ManyStringsNil-4     512           192           -62.50%
BenchmarkTuplePacking/ManyBytes-4          864           448           -48.15%
BenchmarkTuplePacking/ManyBytesNil-4       336           192           -42.86%
BenchmarkTuplePacking/LargeBytes-4         400           192           -52.00%
BenchmarkTuplePacking/LargeBytesNil-4      400           192           -52.00%
BenchmarkTuplePacking/Integers-4           3104          448           -85.57%
BenchmarkTuplePacking/Floats-4             2656          192           -92.77%
BenchmarkTuplePacking/Doubles-4            3104          448           -85.57%
BenchmarkTuplePacking/UUIDs-4              256           192           -25.00%
2018-05-01 10:52:08 +02:00
Vicent Marti
5bab1e8e4e bindings/go: Add tuple packing tests and benchmark
Although the Go bindings to FoundationDB are thoroughly tested as part
of the `bindingtester` operation, this commit implements a more-or-less
complete test case using golden files for the serialized output of
`Tuple.Pack` operations. This will make implementing optimizations and
refactoring the packing operation much simpler.

The same test cases used to verify correctness are also used as a
benchmark suite to measure the amount of memory allocated in the
different operations.
2018-05-01 10:51:57 +02:00
Evan Tschannen
e27531d39e Merge branch 'master' into feature-remote-logs 2018-04-30 22:55:46 -07:00
Evan Tschannen
1265a7b6d5
Merge pull request #285 from alexmiller-apple/NoTLSPluginRequired
Fix the other half of simulation requiring a TLS Plugin.
2018-04-30 22:54:16 -07:00
Evan Tschannen
10d25927cd Merge branch 'master' into feature-remote-logs
# Conflicts:
#	fdbserver/DataDistribution.actor.cpp
2018-04-30 22:15:39 -07:00
Evan Tschannen
eded5631e6 fix: epoch end was already known committed version + 1, and did not need an additional + 1. 2018-04-30 22:03:11 -07:00
Hiroshi Saito
370a6442b3
Fix undefined: e in a code snippet 2018-05-01 10:59:12 +09:00
Evan Tschannen
e1e43cff28 endEpoch implemented using getDurableVersion 2018-04-30 18:32:04 -07:00
Alex Miller
bc8e6acbe8 Fix the other half of simulation requiring a TLS Plugin.
This commit:
1. Restores --tls_plugin as a way to provide the path to the TLS plugin when running in simulation.
2. Removes the TLS Plugin as being required for 5% of tests.
3. Standardizes on 'sslEnabled' as a variable name.

And is a fix/improvement upon commit f7733d1b.

(1) previously didn't work, because we would create multiple new TLSOptions
instances and run init_plugin multiple times.  Only the first call would use
the argument specified on the command line.  To fix this, the TLSOptions
derived from the command line is threaded through all the simulation code that
needs it.

(2) was an oversight in f7733d1b, which didn't actually make "should we be TLS"
dependant on if the TLS plugin was available or not.

(3) is just nice for trying to grep around in the codebase.
2018-04-30 18:26:29 -07:00
Evan Tschannen
5143871fed passed debug ids into all versions of peek() to assist debugging 2018-04-30 13:36:35 -07:00
Evan Tschannen
883f2318a0 test fearless configurations 2018-04-30 13:17:29 -07:00
Evan Tschannen
99598d180b fix: the log router must be initialized with all expected tags to prevent mistakenly choosing a minPopped that is too high 2018-04-30 10:58:41 -07:00
Alec Grieser
8c8e6f86f5
Merge pull request #283 from ajbeamon/release-5.1
(cherry picked from master) java binding: remove unnecessary collection wrapper
2018-04-30 10:10:54 -07:00
Iuri Sitinschi
d52f8eb255 java binding: remove unnecessary collection wrapper 2018-04-30 10:05:53 -07:00
A.J. Beamon
b359e57e78
Merge pull request #276 from isitinschi/master
java binding: remove unnecessary collection wrapper
2018-04-30 10:04:57 -07:00
Evan Tschannen
a484f75c3b
Merge pull request #275 from alecgrieser/merge-release-5.2
Merge release 5.2 into master
2018-04-29 23:23:05 -07:00
Evan Tschannen
92b134eb98 fix: errors from removed were not handled properly 2018-04-29 23:05:08 -07:00
Evan Tschannen
6f318dbff2 fix: do not reply to recruitment until we are sure the log commits to the queue 2018-04-29 22:08:24 -07:00
Evan Tschannen
9cdabfed0e added useful trace events 2018-04-29 18:54:47 -07:00