Fix more unused-variable warnings

This commit is contained in:
Andrew Noyes 2019-04-17 16:04:10 -07:00
parent 13ba915a19
commit ef04471a66
21 changed files with 19 additions and 37 deletions

View File

@ -1260,7 +1260,6 @@ ACTOR Future<std::string> getLayerStatus(Reference<ReadYourWritesTransaction> tr
state std::vector<Future<int64_t>> tagRangeBytes;
state std::vector<Future<int64_t>> tagLogBytes;
state Future<Optional<Value>> fBackupPaused = tr->get(fba.taskBucket->getPauseKey());
state int i = 0;
tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
tr->setOption(FDBTransactionOptions::LOCK_AWARE);

View File

@ -547,7 +547,6 @@ ACTOR static Future<JsonBuilderObject> processStatusFetcher(
Database cx, Optional<DatabaseConfiguration> configuration, Optional<Key> healthyZone, std::set<std::string>* incomplete_reasons) {
state JsonBuilderObject processMap;
state double metric;
// construct a map from a process address to a status object containing a trace file open error
// this is later added to the messages subsection
@ -1787,9 +1786,7 @@ ACTOR Future<JsonBuilderObject> lockedStatusFetcher(Reference<AsyncVar<struct Se
tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE);
try {
choose{
when(Version f = wait(tr.getReadVersion())) {
statusObj["database_locked"] = false;
}
when(wait(success(tr.getReadVersion()))) { statusObj["database_locked"] = false; }
when(wait(getTimeout)) {
incomplete_reasons->insert(format("Unable to determine if database is locked after %d seconds.", timeoutSeconds));

View File

@ -1239,7 +1239,7 @@ private:
// Add the children at this version to the child entries list for the current version being built.
for (auto &childPage : cv->second) {
debug_printf("%p Adding child page '%s'\n", this, printable(childPage.first).c_str());
debug_printf("%p Adding child page '%s'\n", THIS, printable(childPage.first).c_str());
childEntries.emplace_back(childPage.first, StringRef((unsigned char *)&childPage.second, sizeof(uint32_t)));
}
}
@ -1874,7 +1874,6 @@ public:
state Reference<IStoreCursor> cur = self->m_tree->readAtVersion(self->m_tree->getLastCommittedVersion());
state Version readVersion = self->m_tree->getLastCommittedVersion();
if(rowLimit >= 0) {
wait(cur->findFirstEqualOrGreater(keys.begin, true, 0));
while(cur->isValid() && cur->getKey() < keys.end) {
@ -1910,7 +1909,6 @@ public:
ACTOR static Future< Optional<Value> > readValue_impl(KeyValueStoreRedwoodUnversioned *self, Key key, Optional< UID > debugID) {
state Reference<IStoreCursor> cur = self->m_tree->readAtVersion(self->m_tree->getLastCommittedVersion());
state Version readVersion = self->m_tree->getLastCommittedVersion();
wait(cur->findEqual(key));
if(cur->isValid()) {

View File

@ -26,7 +26,6 @@
ACTOR Future<Void> waitFailureServer(FutureStream<ReplyPromise<Void>> waitFailure){
// when this actor is cancelled, the promises in the queue will send broken_promise
state Deque<ReplyPromise<Void>> queue;
state int limit = BUGGIFY ? SERVER_KNOBS->BUGGIFY_OUTSTANDING_WAIT_FAILURE_REQUESTS : SERVER_KNOBS->MAX_OUTSTANDING_WAIT_FAILURE_REQUESTS;
loop {
ReplyPromise<Void> P = waitNext(waitFailure);
queue.push_back(P);

View File

@ -850,7 +850,7 @@ ACTOR Future<Void> watchValue_impl( StorageServer* data, WatchValueRequest req )
if( req.debugID.present() )
g_traceBatch.addEvent("WatchValueDebug", req.debugID.get().first(), "watchValueQ.Before"); //.detail("TaskID", g_network->getCurrentTask());
Version version = wait( waitForVersionNoTooOld( data, req.version ) );
wait(success(waitForVersionNoTooOld(data, req.version)));
if( req.debugID.present() )
g_traceBatch.addEvent("WatchValueDebug", req.debugID.get().first(), "watchValueQ.AfterVersion"); //.detail("TaskID", g_network->getCurrentTask());

View File

@ -346,7 +346,7 @@ TestWorkload *getWorkloadIface( WorkloadRequest work, Reference<AsyncVar<ServerD
ACTOR Future<Void> databaseWarmer( Database cx ) {
loop {
state Transaction tr( cx );
Version v = wait( tr.getReadVersion() );
wait(success(tr.getReadVersion()));
wait( delay( 0.25 ) );
}
}
@ -566,7 +566,7 @@ ACTOR Future<Void> clearData( Database cx ) {
// any other transactions
tr.clear( normalKeys );
tr.makeSelfConflicting();
Version v = wait( tr.getReadVersion() ); // required since we use addReadConflictRange but not get
wait(success(tr.getReadVersion())); // required since we use addReadConflictRange but not get
wait( tr.commit() );
TraceEvent("TesterClearingDatabase").detail("AtVersion", tr.getCommittedVersion());
break;
@ -1073,7 +1073,7 @@ ACTOR Future<Void> runTests( Reference<AsyncVar<Optional<struct ClusterControlle
TraceEvent("TestsExpectedToPass").detail("Count", tests.size());
state int idx = 0;
for(; idx < tests.size(); idx++ ) {
bool ok = wait( runTest( cx, testers, tests[idx], dbInfo ) );
wait(success(runTest(cx, testers, tests[idx], dbInfo)));
// do we handle a failure here?
}

View File

@ -1233,7 +1233,7 @@ ACTOR Future<UID> createAndLockProcessIdFile(std::string folder) {
int64_t fileSize = wait(lockFile.get()->size());
state Key fileData = makeString(fileSize);
int length = wait(lockFile.get()->read(mutateString(fileData), fileSize, 0));
wait(success(lockFile.get()->read(mutateString(fileData), fileSize, 0)));
processIDUid = BinaryReader::fromStringRef<UID>(fileData, IncludeVersion());
}
}

View File

@ -187,19 +187,17 @@ public:
return Void();
//Test the get function
bool getResult = wait(self->runGet(data, self->numGets, self));
wait(::success(self->runGet(data, self->numGets, self)));
//Test the getRange function
state int i;
for(i = 0; i < self->numGetRanges; i++)
bool getRangeResult = wait(self->runGetRange(data, self));
for (i = 0; i < self->numGetRanges; i++) wait(::success(self->runGetRange(data, self)));
//Test the getRange function using key selectors
for(i = 0; i < self->numGetRangeSelectors; i++)
bool getRangeSelectorResult = wait(self->runGetRangeSelector(data, self));
for (i = 0; i < self->numGetRangeSelectors; i++) wait(::success(self->runGetRangeSelector(data, self)));
//Test the getKey function
bool getKeyResult = wait(self->runGetKey(data, self->numGetKeys, self));
wait(::success(self->runGetKey(data, self->numGetKeys, self)));
//Test the clear function
bool clearResult = wait(self->runClear(data, self->numClears, self));

View File

@ -262,7 +262,6 @@ struct ConfigureDatabaseWorkload : TestWorkload {
ACTOR Future<Void> singleDB( ConfigureDatabaseWorkload *self, Database cx ) {
state Transaction tr;
state int i;
state bool firstFearless = false;
loop {
if(g_simulator.speedUpSimulation) {
return Void();

View File

@ -75,7 +75,6 @@ struct ConflictRangeWorkload : TestWorkload {
ACTOR Future<Void> conflictRangeClient(Database cx, ConflictRangeWorkload *self) {
state int i;
state int j;
state std::string clientID;
state std::string myKeyA;
state std::string myKeyB;

View File

@ -250,8 +250,8 @@ struct ConsistencyCheckWorkload : TestWorkload
throw;
}
bool hasStorage = wait( self->checkForStorage(cx, configuration, self) );
bool hasExtraStores = wait( self->checkForExtraDataStores(cx, self) );
wait(::success(self->checkForStorage(cx, configuration, self)));
wait(::success(self->checkForExtraDataStores(cx, self)));
//Check that each machine is operating as its desired class
bool usingDesiredClasses = wait(self->checkUsingDesiredClasses(cx, self));
@ -282,7 +282,7 @@ struct ConsistencyCheckWorkload : TestWorkload
state Standalone<VectorRef<KeyValueRef>> keyLocations = keyLocationPromise.getFuture().get();
//Check that each shard has the same data on all storage servers that it resides on
bool dataConsistencyResult = wait(self->checkDataConsistency(cx, keyLocations, configuration, self));
wait(::success(self->checkDataConsistency(cx, keyLocations, configuration, self)));
}
}
}

View File

@ -214,7 +214,6 @@ struct DDBalanceWorkload : TestWorkload {
state int currentBin = self->currentbin;
state int nextBin = 0;
state int i;
state int j;
state int key_space_drift = 0;
state double clientBegin = now();

View File

@ -285,7 +285,6 @@ ACTOR Future<Void> testKVStoreMain( KVStoreTestWorkload* workload, KVTest* ptest
printf("Building %d nodes: ", workload->nodeCount);
state double setupBegin = timer();
state double setupNow = now();
state Future<Void> lastCommit = Void();
for(i=0; i<workload->nodeCount; i++) {
test.store->set( KeyValueRef( test.makeKey( i ), wr.toValue() ) );

View File

@ -67,7 +67,7 @@ struct LogMetricsWorkload : TestWorkload {
loop {
state Transaction tr(cx);
try {
Version v = wait( tr.getReadVersion() );
wait(success(tr.getReadVersion()));
tr.set(fastLoggingEnabled, br.toValue());
tr.makeSelfConflicting();
wait( tr.commit() );

View File

@ -90,8 +90,6 @@ struct MetricLoggingWorkload : TestWorkload {
ACTOR Future<Void> MetricLoggingClient( Database cx, MetricLoggingWorkload *self, int clientId, int actorId ) {
state BinaryWriter writer( Unversioned() );
state uint64_t lastTime = 0;
state double startTime = now();
loop {
for( int i = 0; i < 100; i++ ) {
if( self->testBool ) {

View File

@ -239,7 +239,6 @@ struct PingWorkload : TestWorkload {
ACTOR Future<Void> payloadPinger(PingWorkload* self, Database cx, vector<RequestStream<LoadedPingRequest>> peers) {
// state vector<PingWorkloadInterface> peers = wait( self->fetchInterfaces( self, cx ) );
state double lastTime = now();
// loop {
state double start = now();

View File

@ -109,7 +109,7 @@ struct QueuePushWorkload : TestWorkload {
loop {
try {
state double start = now();
Version v = wait( tr.getReadVersion() );
wait(success(tr.getReadVersion()));
self->GRVLatencies.addSample( now() - start );
// Get the last key in the database with a snapshot read

View File

@ -63,7 +63,6 @@ struct UnitTestWorkload : TestWorkload {
ACTOR static Future<Void> runUnitTests(UnitTestWorkload* self) {
state std::vector<UnitTest*> tests;
state int allTestCount = 0;
for (auto t = g_unittests.tests; t != NULL; t = t->next) {
if (StringRef(t->name).startsWith(self->testPattern)) {

View File

@ -180,7 +180,7 @@ struct WatchesWorkload : TestWorkload {
state bool firstAttempt = true;
loop {
try {
state Version readVer = wait( tr.getReadVersion() );
wait(success(tr.getReadVersion()));
Optional<Value> _startValue = wait( tr.get( startKey ) );
if( firstAttempt ) {
startValue = _startValue;
@ -199,7 +199,6 @@ struct WatchesWorkload : TestWorkload {
tr.clear( startKey );
wait( tr.commit() );
//TraceEvent("WatcherInitialSet").detail("Start", printable(startKey)).detail("End", printable(endKey)).detail("Value", printable( expectedValue ) ).detail("Ver", tr.getCommittedVersion()).detail("ReadVer", readVer);
break;
} catch( Error &e ) {
wait( tr.onError(e) );

View File

@ -113,7 +113,7 @@ struct WriteBandwidthWorkload : KVWorkload {
loop {
try {
state double start = now();
Version v = wait( tr.getReadVersion() );
wait(success(tr.getReadVersion()));
self->GRVLatencies.addSample( now() - start );
// Predefine a single large write conflict range over the whole key space

View File

@ -358,7 +358,7 @@ struct WriteDuringReadWorkload : TestWorkload {
}
ACTOR Future<Void> commitAndUpdateMemory( ReadYourWritesTransaction *tr, WriteDuringReadWorkload* self, bool *cancelled, bool readYourWritesDisabled, bool snapshotRYWDisabled, bool readAheadDisabled, bool useBatchPriority, bool* doingCommit, double* startTime, Key timebombStr ) {
state UID randomID = g_nondeterministic_random->randomUniqueID();
//state UID randomID = g_nondeterministic_random->randomUniqueID();
//TraceEvent("WDRCommit", randomID);
try {
if( !readYourWritesDisabled && !*cancelled ) {