update key bug fix

This commit is contained in:
Dwight 2007-12-14 12:48:47 -05:00
parent a7b7184f09
commit f94a9d3fa5
4 changed files with 25 additions and 4 deletions

View File

@ -33,6 +33,9 @@ void BucketBasics::_shape(int level, stringstream& ss) {
void BucketBasics::fullValidate(const DiskLoc& thisLoc) {
assertValid();
if( 1 )
return; // off for now...
for( int i = 0; i < n; i++ ) {
_KeyNode& kn = k(i);
if( !kn.prevChildBucket.isNull() ) {

View File

@ -409,9 +409,9 @@ void setDifference(set<JSObj>& l, set<JSObj>& r, vector<JSObj*> &diff) {
break;
while( j != r.end() && *j < *i )
j++;
if( !i->woEqual(*j) ) {
const JSObj *j = &*i;
diff.push_back( (JSObj *) j );
if( j == r.end() || !i->woEqual(*j) ) {
const JSObj *jo = &*i;
diff.push_back( (JSObj *) jo );
}
i++;
}

View File

@ -8,6 +8,9 @@
#include <time.h>
#include "../util/goodies.h"
// if you want trace output:
#define mmm(x)
/* listener ------------------------------------------------------------------- */
void Listener::listen() {
@ -90,6 +93,7 @@ bool MessagingPort::connect(SockAddr& _far)
}
bool MessagingPort::recv(Message& m) {
mmm( cout << "* recv() sock:" << this->sock << endl; )
int len;
int x = ::recv(sock, (char *) &len, 4, 0);
@ -138,6 +142,8 @@ void MessagingPort::reply(Message& received, Message& response) {
}
bool MessagingPort::call(SockAddr& to, Message& toSend, Message& response) {
mmm( cout << "*call()" << endl; )
MSGID old = toSend.data->id;
say(to, toSend);
while( 1 ) {
bool ok = recv(response);
@ -146,13 +152,20 @@ bool MessagingPort::call(SockAddr& to, Message& toSend, Message& response) {
//cout << "got response: " << response.data->responseTo << endl;
if( response.data->responseTo == toSend.data->id )
break;
cout << "warning: MessagingPort::call() wrong id, skipping. got:" << response.data->responseTo << " expect:" << toSend.data->id << endl;
cout << "********************" << endl;
cout << "ERROR: MessagingPort::call() wrong id got:" << response.data->responseTo << " expect:" << toSend.data->id << endl;
cout << " old:" << old << endl;
cout << " response msgid:" << response.data->id << endl;
cout << " response len: " << response.data->len << endl;
assert(false);
response.reset();
}
mmm( cout << "*call() end" << endl; )
return true;
}
void MessagingPort::say(SockAddr& to, Message& toSend, int responseTo) {
mmm( cout << "* say() sock:" << this->sock << " thr:" << GetCurrentThreadId() << endl; )
MSGID msgid = NextMsgId;
++NextMsgId;
toSend.data->id = msgid;

View File

@ -5,6 +5,11 @@
#include "../stdafx.h"
#if !defined(_WIN32)
#include <pthread.h>
inline pthread_t GetCurrentThreadId() { return pthread_self(); }
#endif
/* set to TRUE if we are exiting */
extern bool goingAway;