Merge branch 'flatbuffers-fixes2' of github.com:mpilman/foundationdb into flatbuffers-fixes2
This commit is contained in:
commit
d5caf0c1b4
|
@ -2740,7 +2740,7 @@ int main(int argc, char* argv[]) {
|
|||
bool dryRun = false;
|
||||
std::string traceDir = "";
|
||||
std::string traceFormat = "";
|
||||
bool useObjectSerializer = false;
|
||||
bool useObjectSerializer = true;
|
||||
std::string traceLogGroup;
|
||||
uint64_t traceRollSize = TRACE_DEFAULT_ROLL_SIZE;
|
||||
uint64_t traceMaxLogsSize = TRACE_DEFAULT_MAX_LOGS_SIZE;
|
||||
|
@ -2855,7 +2855,7 @@ int main(int argc, char* argv[]) {
|
|||
std::string s = args->OptionArg();
|
||||
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
|
||||
if (s == "on" || s == "true" || s == "1") {
|
||||
useObjectSerializer = true;
|
||||
useObjectSerializer = true;
|
||||
} else if (s == "off" || s == "false" || s == "0") {
|
||||
useObjectSerializer = false;
|
||||
} else {
|
||||
|
|
|
@ -2349,7 +2349,7 @@ struct CLIOptions {
|
|||
bool trace;
|
||||
std::string traceDir;
|
||||
std::string traceFormat;
|
||||
bool useObjectSerializer = false;
|
||||
bool useObjectSerializer = true;
|
||||
int exit_timeout;
|
||||
Optional<std::string> exec;
|
||||
bool initialStatusCheck;
|
||||
|
|
|
@ -246,10 +246,10 @@ TEST_CASE("/flow/FlatBuffers/LeaderInfo") {
|
|||
}
|
||||
in.serializedInfo = rndString;
|
||||
}
|
||||
ObjectWriter writer(Unversioned());
|
||||
ObjectWriter writer(IncludeVersion());
|
||||
writer.serialize(in);
|
||||
Standalone<StringRef> copy = writer.toStringRef();
|
||||
ArenaObjectReader reader(copy.arena(), copy, Unversioned());
|
||||
ArenaObjectReader reader(copy.arena(), copy, IncludeVersion());
|
||||
reader.deserialize(out);
|
||||
ASSERT(in.forward == out.forward);
|
||||
ASSERT(in.changeID == out.changeID);
|
||||
|
@ -268,10 +268,10 @@ TEST_CASE("/flow/FlatBuffers/LeaderInfo") {
|
|||
ErrorOr<EnsureTable<Optional<LeaderInfo>>> objIn(leaderInfo);
|
||||
ErrorOr<EnsureTable<Optional<LeaderInfo>>> objOut;
|
||||
Standalone<StringRef> copy;
|
||||
ObjectWriter writer(Unversioned());
|
||||
ObjectWriter writer(IncludeVersion());
|
||||
writer.serialize(objIn);
|
||||
copy = writer.toStringRef();
|
||||
ArenaObjectReader reader(copy.arena(), copy, Unversioned());
|
||||
ArenaObjectReader reader(copy.arena(), copy, IncludeVersion());
|
||||
reader.deserialize(objOut);
|
||||
|
||||
ASSERT(!objOut.isError());
|
||||
|
|
|
@ -67,7 +67,7 @@ struct NetworkOptions {
|
|||
NetworkOptions()
|
||||
: localAddress(""), clusterFile(""), traceDirectory(Optional<std::string>()),
|
||||
traceRollSize(TRACE_DEFAULT_ROLL_SIZE), traceMaxLogsSize(TRACE_DEFAULT_MAX_LOGS_SIZE), traceLogGroup("default"),
|
||||
traceFormat("xml"), slowTaskProfilingEnabled(false), useObjectSerializer(false) {}
|
||||
traceFormat("xml"), slowTaskProfilingEnabled(false), useObjectSerializer(true) {}
|
||||
};
|
||||
|
||||
class Database {
|
||||
|
|
|
@ -897,7 +897,7 @@ ACTOR static Future<Void> connectionReader(
|
|||
.suppressFor(1.0)
|
||||
.detail("Peer", conn->getPeerAddress())
|
||||
.detail("ConnectionId", connectionId)
|
||||
.detail("UseObjectSerializer", false);
|
||||
.detail("UseObjectSerializer", g_network->useObjectSerializer());
|
||||
}
|
||||
|
||||
if(connectionId > 1) {
|
||||
|
|
|
@ -944,7 +944,7 @@ int main(int argc, char* argv[]) {
|
|||
double fileIoTimeout = 0.0;
|
||||
bool fileIoWarnOnly = false;
|
||||
uint64_t rsssize = -1;
|
||||
bool useObjectSerializer = false;
|
||||
bool useObjectSerializer = true;
|
||||
|
||||
if( argc == 1 ) {
|
||||
printUsage(argv[0], false);
|
||||
|
|
|
@ -94,7 +94,7 @@ class ObjectReader : public _ObjectReader<ObjectReader> {
|
|||
uint64_t result;
|
||||
memcpy(&result, _data, sizeof(result));
|
||||
_data += sizeof(result);
|
||||
version = ProtocolVersion(version);
|
||||
version = ProtocolVersion(result);
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
|
@ -120,7 +120,7 @@ class ArenaObjectReader : public _ObjectReader<ArenaObjectReader> {
|
|||
uint64_t result;
|
||||
memcpy(&result, _data, sizeof(result));
|
||||
_data += sizeof(result);
|
||||
version = ProtocolVersion(version);
|
||||
version = ProtocolVersion(result);
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
|
@ -164,12 +164,11 @@ public:
|
|||
int allocations = 0;
|
||||
auto allocator = [this, &allocations](size_t size_) {
|
||||
++allocations;
|
||||
size = size_;
|
||||
auto toAllocate = writeProtocolVersion ? size + sizeof(uint64_t) : size;
|
||||
this->size = writeProtocolVersion ? size_ + sizeof(uint64_t) : size_;
|
||||
if (customAllocator) {
|
||||
data = customAllocator(toAllocate);
|
||||
data = customAllocator(this->size);
|
||||
} else {
|
||||
data = new (arena) uint8_t[toAllocate];
|
||||
data = new (arena) uint8_t[this->size];
|
||||
}
|
||||
if (writeProtocolVersion) {
|
||||
auto v = protocolVersion().versionWithFlags();
|
||||
|
|
|
@ -268,19 +268,7 @@ def run_simulation_test(basedir, options):
|
|||
fdbserver = os.path.join(basedir, 'bin', 'fdbserver')
|
||||
pargs = [fdbserver,
|
||||
'-r', options.testtype]
|
||||
if options.testtype == 'test':
|
||||
pargs.append('-C')
|
||||
pargs.append(os.path.join(args.builddir, 'fdb.cluster'))
|
||||
else:
|
||||
pargs.append('-S')
|
||||
pargs.append('on')
|
||||
td = TestDirectory(basedir)
|
||||
if options.buggify:
|
||||
pargs.append('-b')
|
||||
pargs.append('on')
|
||||
pargs.append('--trace_format')
|
||||
pargs.append(options.log_format)
|
||||
test_dir = td.get_current_test_dir()
|
||||
seed = 0
|
||||
if options.seed is not None:
|
||||
pargs.append('-s')
|
||||
seed = int(options.seed, 0)
|
||||
|
@ -288,6 +276,19 @@ def run_simulation_test(basedir, options):
|
|||
idx = int(options.test_number)
|
||||
seed = ((seed + idx) % (2**32-2)) + 1
|
||||
pargs.append("{}".format(seed))
|
||||
if options.testtype == 'test':
|
||||
pargs.append('-C')
|
||||
pargs.append(os.path.join(args.builddir, 'fdb.cluster'))
|
||||
else:
|
||||
pargs.append('-S')
|
||||
pargs.append('on' if seed % 2 == 0 else 'off')
|
||||
td = TestDirectory(basedir)
|
||||
if options.buggify:
|
||||
pargs.append('-b')
|
||||
pargs.append('on')
|
||||
pargs.append('--trace_format')
|
||||
pargs.append(options.log_format)
|
||||
test_dir = td.get_current_test_dir()
|
||||
wd = os.path.join(test_dir,
|
||||
'test_{}'.format(options.name.replace('/', '_')))
|
||||
os.mkdir(wd)
|
||||
|
|
Loading…
Reference in New Issue