Sherpa 1.10 storage/handler/unit test/ now runs to completion with the following failures:

make: *** [testCachedMetadataStorerun] Error 255
make: *** [testGetCopyStatusrun] Error 255
make: *** [testGetLbStatsrun] Error 255
make: *** [testGetRecordFormatterrun] Error 255
make: *** [testGetSplitPointrun] Error 255
make: *** [testGetTabletMetadatarun] Error 255
make: *** [testKillRecordrun] Error 255
make: *** [testMySQLPersistentrun] Error 255
make: *** [testMySQLUpgrade16to18run] Error 255
make: *** [testPingrun] Error 255
make: *** [testRecordUtilsrun] Error 255
make: *** [testResetRecordMetadatarun] Error 255
make: *** [testScanTabletrun] Error 255
make: *** [testTabletrun] Error 255



git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@1151 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
sears 2010-09-15 22:37:50 +00:00
parent 2eda51e176
commit 3e8ffcbd7f
2 changed files with 16 additions and 4 deletions

View file

@ -75,11 +75,17 @@ public:
std::string dbg2((char*)end_key, end_key_len - 1);
lsmImpl->filestr << "end lsm key = " << dbg2 << std::endl;
logstore_client_op_returns_many(lsmImpl->l_, OP_SCAN, starttup, endtup, scanLimit);
uint8_t rc = logstore_client_op_returns_many(lsmImpl->scan_l_, OP_SCAN, starttup, endtup, scanLimit);
datatuple::freetuple(starttup);
datatuple::freetuple(endtup);
if(rc != LOGSTORE_RESPONSE_SENDING_TUPLES) {
this->error = rc;
} else {
this->error = 0;
}
this->data = new StorageRecord();
}
~LSMIterator() {
@ -93,7 +99,9 @@ public:
SuCode::ResponseCode next() {
datatuple * tup;
lsmImpl->filestr << "next called" << std::endl;
if((tup = logstore_client_next_tuple(lsmImpl->l_))) {
if(error) { // only catches errors during scan setup.
return SuCode::PStoreUnexpectedError;
} else if((tup = logstore_client_next_tuple(lsmImpl->scan_l_))) {
lsmImpl->filestr << "found tuple, key = " << tup->key() << " datalen = " << tup->datalen() << std::endl;
SuCode::ResponseCode rc = lsmImpl->tup_buf(*(this->data), tup);
datatuple::freetuple(tup);
@ -107,6 +115,7 @@ public:
}
private:
LSMPersistentStoreImpl * lsmImpl;
uint8_t error;
};
// Initialize the logger
@ -315,9 +324,10 @@ LSMPersistentStoreImpl::val_buf(StorageRecord& ret,
return SuCode::SuOk;
}
LSMPersistentStoreImpl::
LSMPersistentStoreImpl(bool isOrdered) : isOrdered_(isOrdered), l_(NULL) {
LSMPersistentStoreImpl(bool isOrdered) : isOrdered_(isOrdered), l_(NULL), scan_l_(NULL) {
filestr.open(isOrdered? "/tmp/lsm-log" : "/tmp/lsm-log-hashed", std::fstream::out | std::fstream::app);
l_ = logstore_client_open("localhost", 32432, 60); // XXX hardcode none of these values
scan_l_ = logstore_client_open("localhost", 32432, 60); // XXX hardcode none of these values
filestr << "LSMP constructor called" << std::endl;
}
@ -326,6 +336,7 @@ LSMPersistentStoreImpl::
{
filestr << "LSMP destructor called" << std::endl;
logstore_client_close(l_);
logstore_client_close(scan_l_);
}
SuCode::ResponseCode LSMPersistentStoreImpl::initMetadataMetadata(TabletMetadata& m) {
@ -621,7 +632,7 @@ scan(const TabletMetadata& tabletMeta, const ScanContinuation& continuation,
selector, /*getMetadataOnly,*/
expiryTime, scanLimit, byteLimit);
filestr << "LSMP scan returns" << std::endl;
filestr << "LSMP scan returns. Error = " << iter->error << std::endl;
return StorageRecordIterator(iter);
}

View file

@ -176,6 +176,7 @@ private:
void buf_metadata(unsigned char ** buf, size_t *len, const TabletMetadata &m);
protected:
logstore_handle_t * l_;
logstore_handle_t * scan_l_; // XXX make sure that one scan handle per process suffices.
};