From: John David Duncan Date: September 28 2011 4:03am Subject: bzr push into mysql-5.5-cluster branch (john.duncan:3560 to 3563) List-Archive: http://lists.mysql.com/commits/141172 Message-Id: <201109280403.p8S43iJM013555@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3563 John David Duncan 2011-09-27 Removed errant assertion (the Ndb's custom data pointer holds an NdbInstance, not a workitem) modified: storage/ndb/memcache/src/ndb_worker.cc 3562 John David Duncan 2011-09-27 Don't override member variable Record::index inside methods modified: storage/ndb/memcache/src/Record.cc 3561 John David Duncan 2011-09-27 Change record layout so that CAS columns are always 8-byte aligned. modified: storage/ndb/memcache/src/Record.cc storage/ndb/memcache/src/ndb_pipeline.cc storage/ndb/memcache/src/schedulers/S_sched.cc 3560 John David Duncan 2011-09-27 Fix syntax error in cmake file modified: storage/ndb/memcache/atomics.cmake === modified file 'storage/ndb/memcache/src/Record.cc' --- a/storage/ndb/memcache/src/Record.cc 2011-09-27 16:47:17 +0000 +++ b/storage/ndb/memcache/src/Record.cc 2011-09-28 03:42:51 +0000 @@ -71,6 +71,13 @@ void Record::addColumn(short col_type, c /* Build the Record Specification */ specs[index].column = column; + + /* The CAS is manipulated using Record::getPointer() and must be aligned */ + if(col_type == COL_STORE_CAS) { + int bad_offset = rec_size % 8; + if(bad_offset) rec_size += (8 - bad_offset); + } + specs[index].offset = rec_size; /* use the current record size */ if(column->getNullable()) { specs[index].nullbit_byte_offset = n_nullable / 8; @@ -128,9 +135,9 @@ bool Record::complete(NdbDictionary::Dic bool Record::complete(NdbDictionary::Dictionary *dict, - const NdbDictionary::Index *index) { + const NdbDictionary::Index *ndb_index) { build_null_bitmap(); - ndb_record = dict->createRecord(index, specs, ncolumns, sizeof(specs[0])); + ndb_record = dict->createRecord(ndb_index, specs, ncolumns, sizeof(specs[0])); if(!ndb_record) { logger->log(LOG_WARNING, 0, "createRecord() failure: %s\n", @@ -195,9 +202,9 @@ size_t Record::decodeCopy(int id, char * int Record::getIntValue(int id, char *data) const { - int index = map[id]; - NumericHandler * h = handlers[index]->native_handler; - const char * buffer = data + specs[index].offset; + int idx = map[id]; + NumericHandler * h = handlers[idx]->native_handler; + const char * buffer = data + specs[idx].offset; int i = 0; if(h) { @@ -205,35 +212,35 @@ int Record::getIntValue(int id, char *da } else { logger->log(LOG_WARNING, 0, "getIntValue() failed for column %s - " - "unsupported column type.", specs[index].column->getName()); + "unsupported column type.", specs[idx].column->getName()); } return i; } bool Record::setIntValue(int id, int value, char *data) const { - int index = map[id]; - NumericHandler * h = handlers[index]->native_handler; - char * buffer = data + specs[index].offset; + int idx = map[id]; + NumericHandler * h = handlers[idx]->native_handler; + char * buffer = data + specs[idx].offset; if(h) { return (h->write_int32(value,buffer) > 0); } else { logger->log(LOG_WARNING, 0, "setIntValue() failed for column %s - " - "unsupported column type.", specs[index].column->getName()); + "unsupported column type.", specs[idx].column->getName()); return false; } } Uint64 Record::getUint64Value(int id, char *data) const { - int index = map[id]; - const char * buffer = data + specs[index].offset; + int idx = map[id]; + const char * buffer = data + specs[idx].offset; - if(specs[index].column->getType() != NdbDictionary::Column::Bigunsigned) { + if(specs[idx].column->getType() != NdbDictionary::Column::Bigunsigned) { logger->log(LOG_WARNING, 0, "Operation failed - column %s must be BIGINT UNSIGNED", - specs[index].column->getName()); + specs[idx].column->getName()); return 0; } @@ -243,12 +250,12 @@ Uint64 Record::getUint64Value(int id, ch bool Record::setUint64Value(int id, Uint64 value, char *data) const { - int index = map[id]; - char * buffer = data + specs[index].offset; + int idx = map[id]; + char * buffer = data + specs[idx].offset; - if(specs[index].column->getType() != NdbDictionary::Column::Bigunsigned) { + if(specs[idx].column->getType() != NdbDictionary::Column::Bigunsigned) { logger->log(LOG_WARNING, 0, "Operation failed - column %s must be BIGINT UNSIGNED", - specs[index].column->getName()); + specs[idx].column->getName()); return false; } === modified file 'storage/ndb/memcache/src/ndb_pipeline.cc' --- a/storage/ndb/memcache/src/ndb_pipeline.cc 2011-09-22 18:27:10 +0000 +++ b/storage/ndb/memcache/src/ndb_pipeline.cc 2011-09-28 03:29:26 +0000 @@ -378,6 +378,7 @@ void init_allocator(ndb_pipeline *self) if(workitem_class_id > 8) malloc_new_slab(& self->alligator[workitem_class_id]); /* for workitems */ malloc_new_slab(& self->alligator[13]); /* The 8KB class, for row buffers */ + malloc_new_slab(& self->alligator[14]); /* The 16KB class for 13K rows */ } === modified file 'storage/ndb/memcache/src/ndb_worker.cc' --- a/storage/ndb/memcache/src/ndb_worker.cc 2011-09-23 23:56:04 +0000 +++ b/storage/ndb/memcache/src/ndb_worker.cc 2011-09-28 03:58:19 +0000 @@ -518,9 +518,6 @@ op_status_t worker_do_math(workitem *wqi void DB_callback(int result, NdbTransaction *tx, void *itemptr) { workitem *wqitem = (workitem *) itemptr; - - assert(tx->getNdb()->getCustomData() == wqitem); - ndb_pipeline * & pipeline = wqitem->pipeline; status_block * return_status; bool tx_did_match = false; === modified file 'storage/ndb/memcache/src/schedulers/S_sched.cc' --- a/storage/ndb/memcache/src/schedulers/S_sched.cc 2011-09-26 21:12:27 +0000 +++ b/storage/ndb/memcache/src/schedulers/S_sched.cc 2011-09-28 03:29:26 +0000 @@ -884,9 +884,9 @@ void * S::Connection::run_ndb_poll_threa in_flight--; assert(in_flight >= 0); Ndb *db = ready_list[i]; - db->pollNdb(0, 1); inst = (NdbInstance *) db->getCustomData(); DEBUG_PRINT("Polling %d.%d", inst->wqitem->pipeline->id, inst->wqitem->id); + db->pollNdb(0, 1); if(inst->wqitem->base.reschedule) { DEBUG_PRINT("Rescheduling %d.%d", inst->wqitem->pipeline->id, inst->wqitem->id); No bundle (reason: useless for push emails).