51 Commits

Author SHA1 Message Date
sfc-gh-tclinkenbeard
0d9eaa5d6d Add ISingleThreadTransaction.h 2021-04-29 22:31:16 -07:00
FDB Formatster
df90cc89de apply clang-format to *.c, *.cpp, *.h, *.hpp files 2021-03-10 10:18:07 -08:00
Andrew Noyes
54d5f6562e Fix clang11 warning
Apparently clang11 warns if you pass uninitialized memory to a function
accepting a const reference. Seems fair. This change doesn't actually
fix any bugs, but it silences the warning.
2020-10-13 17:27:55 +00:00
Xiaoxi Wang
548ba06510 change map to deque; code style problem 2020-08-14 18:30:58 +00:00
sfc-gh-tclinkenbeard
abaae40453 Modified ComposedIdentifier to prevent file identifier conflicts at
compile-time
2020-07-20 18:52:44 -07:00
A.J. Beamon
aed97a9f20 Merge branch 'master' into transaction-tagging 2020-05-07 14:52:22 -07:00
Andrew Noyes
e5d1aefd74 Fix typo 2020-05-02 00:12:08 +00:00
Andrew Noyes
81a4e7d32d Reduce size of flatbuffers messages
If a flatbuffers message contains many empty strings, its serialized
size is currently unnecessarily large. Point all relative offsets for
empty strings/vectors to the same memory, saving 4 bytes per extra empty
string/vector.
2020-05-01 18:13:51 +00:00
A.J. Beamon
41c517a5dd Merge branch 'master' into transaction-tagging
# Conflicts:
#	fdbclient/NativeAPI.actor.cpp
2020-04-27 13:05:24 -07:00
Evan Tschannen
c87aa33941 Merge branch 'release-6.2'
# Conflicts:
#	CMakeLists.txt
#	bindings/go/src/fdb/generated.go
#	documentation/sphinx/source/api-common.rst.inc
#	documentation/sphinx/source/api-ruby.rst
#	documentation/sphinx/source/release-notes.rst
#	fdbclient/FailureMonitorClient.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbclient/vexillographer/fdb.options
#	fdbrpc/FlowTransport.actor.cpp
#	fdbserver/OldTLogServer_6_0.actor.cpp
#	fdbserver/TLogServer.actor.cpp
#	fdbserver/fdbserver.actor.cpp
#	versions.target
2020-04-23 13:47:53 -07:00
A.J. Beamon
5258910f86 Move unordered_map include 2020-04-22 12:33:58 -07:00
Andrew Noyes
cb6389d42d Prevent main thread from destroying flatbuffers globals
We recently witnessed (using tsan) the main thread exiting without first
joining the network thread, and this caused data races and
heap-use-after-free's

Now the lifetime of these globals will be tied to the network thread
itself (and I guess every thread, but the one that actually uses memory
will be owned by the network thread.)
2020-04-17 23:34:28 +00:00
A.J. Beamon
29b2c2f3aa Add hash to StringRef. Use unordered maps for storing tags. Create some helpful typedefs. 2020-04-10 12:54:59 -07:00
Evan Tschannen
303df197cf Merge branch 'release-6.2'
# Conflicts:
#	CMakeLists.txt
#	bindings/c/test/mako/mako.c
#	documentation/sphinx/source/release-notes.rst
#	fdbbackup/backup.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbclient/NativeAPI.actor.h
#	fdbserver/DataDistributionQueue.actor.cpp
#	fdbserver/Knobs.cpp
#	fdbserver/Knobs.h
#	fdbserver/LogRouter.actor.cpp
#	fdbserver/SkipList.cpp
#	fdbserver/fdbserver.actor.cpp
#	flow/CMakeLists.txt
#	flow/Knobs.cpp
#	flow/Knobs.h
#	flow/flow.vcxproj
#	flow/flow.vcxproj.filters
#	versions.target
2020-03-06 18:22:46 -08:00
Andrew Noyes
24bbf5a8f0 Avoid invalid read on invalid Void msg 2020-03-02 12:11:43 -08:00
mpilman
52ca752dd3 Merge remote-tracking branch 'origin/features/icc' into features/icc 2020-02-04 10:29:49 -08:00
mpilman
d09e07f1f5 Merge remote-tracking branch 'upstream/master' into features/icc 2020-02-04 10:26:18 -08:00
Alvin Moore
3bf971ba8b Merge branch 'release-6.2' of github.com:apple/foundationdb into release_6.2_merge
# Conflicts:
#	documentation/sphinx/source/release-notes.rst
#	fdbserver/storageserver.actor.cpp
2019-12-12 07:13:12 -08:00
Meng Xu
7eaf76bacf
Merge pull request #2389 from atn34/atn34/default-init-flatbuffers
Default initialize absent flatbuffers members
2019-11-27 21:16:27 -08:00
Andrew Noyes
c4e01301b0 Fix a potential UB instance
Writing a value which is not 0 or 1 to the underlying memory of a bool
is undefined behavior. Conformant flatbuffers implementations must
accept bytes that are not 0 or 1 as booleans [1]. (Conformant
implementations are only allowed to write the byte 0 or 1 as a boolean
[1])

So this protects us from undefined behavior if we ever read a
flatbuffers message written by an almost-conformant implementation.

[1]: https://github.com/dvidelabs/flatcc/blob/master/doc/binary-format.md#boolean
2019-11-26 11:18:17 -08:00
Andrew Noyes
17ab2f8e00 Default initialize absent flatbuffers members 2019-11-26 10:58:29 -08:00
Andrew Noyes
b7b5d2ead3 Remove several nonsensical const uses
These seem to be all the ones that clang's -Wignored-qualifiers
complains about
2019-10-26 14:30:34 -07:00
Andrew Noyes
a5314e2cee ObjectSerializer fixes for pr/2086 2019-09-11 13:31:07 -07:00
Andrew Noyes
7ecd31da5a Fix EnsureTable<T> where T has a LoadSaveHelper specialization 2019-09-11 13:11:58 -07:00
Evan Tschannen
dc668d1fc9 attempt to fix the serialization of CachedSerialization 2019-09-11 11:45:07 -07:00
Andrew Noyes
26a3672751 Disallow scalars from being root types
By not specializing FileIdentifierFor for them
2019-08-28 14:40:06 -07:00
Andrew Noyes
d0ecdb4fb1 Replace std::map with sorted std::vector 2019-07-30 16:17:14 -07:00
mpilman
6c6a1ca8f4 Expose serialization context too all traits 2019-07-15 12:58:31 -07:00
mpilman
cb7b941452 expose protocolVersion to serialize function
The main idea here is that we now have a context for
serialization and deserialization. This can be used
to access the protocolVersion.

The context still needs to be exposed to the
deserailization traits
2019-07-12 17:16:54 -07:00
Andrew Noyes
eb87b1fc61 Remove dead code 2019-07-11 23:03:31 -07:00
Andrew Noyes
70eac949e6 Zero-initialize memory more precisely
Also fix two alignment bugs
2019-07-11 23:03:31 -07:00
Andrew Noyes
a34f8d70d6 Re-use writeToOffsets vector 2019-07-11 23:03:31 -07:00
Andrew Noyes
f8584d0df8 Implement new dynamic_size_traits 2019-07-11 23:03:31 -07:00
Andrew Noyes
15c6f2b864 Explain SFINAE for has_serialization_done 2019-07-05 14:07:02 -07:00
Andrew Noyes
e2ed56fa56 Convert ownedPtr to unownedPtr for IReplicationPolicy
Remove WriteRawMemory feature

Remove deserialization_done
2019-07-05 14:07:02 -07:00
Andrew Noyes
9894d928a1 Re-use identical vtables 2019-07-05 14:07:02 -07:00
Andrew Noyes
4c5ebd7609 Avoid assert when collecting vtables 2019-07-05 14:07:02 -07:00
Markus Pilman
77751d0127
Fixed typo
Co-Authored-By: A.J. Beamon <ajbeamon@users.noreply.github.com>
2019-07-03 09:51:57 -07:00
mpilman
844dd60202 FDB compiling with intel compiler 2019-06-20 09:29:01 -07:00
mpilman
5a13915960 implemented std::set serializer for flatbuffers 2019-05-13 14:15:23 -07:00
mpilman
46e7a0ca56 address reviews and make compile with -Wunused-variable 2019-05-13 14:15:23 -07:00
mpilman
96aaa31a6c Compiling on clang again 2019-05-13 14:15:23 -07:00
mpilman
0713e06efc Started to work on Windows 2019-05-13 14:15:23 -07:00
mpilman
f5fa3a65b4 some more fixes 2019-05-13 14:15:23 -07:00
mpilman
44db3450ec Several flatbuffers bug fixes 2019-05-13 14:15:23 -07:00
mpilman
f0d81c6820 make EnsureTable work with streaming serializer 2019-05-13 14:15:22 -07:00
Andrew Noyes
0a3676111e Support vector of unions in flatbuffers 2019-05-13 14:15:22 -07:00
mpilman
642a96807b Fixed compilation issues after rebase 2019-05-13 14:15:22 -07:00
mpilman
ba83c458a6 types implemented 2019-05-13 14:15:22 -07:00
mpilman
fe81454ec2 basic functionality for object serializer
This commit includes:
- The flatbuffers implementation
- A draft on how it should be used for network messages
- A serializer that can be used independently

What is missing:
- All root objects will need a file identifier
- Many special classes can not be serialized yet as the
  corresponding traits are not yet implemented
- Object serialization can not yet be turned on (this will
  need a network option)
2019-05-13 14:15:22 -07:00