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