From: Stewart Smith Date: December 8 2005 10:29am Subject: bk commit into 5.0 tree (stewart:1.1992) List-Archive: http://lists.mysql.com/commits/38 Message-Id: <20051208102913.91F43145C4D7@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of stewart. When stewart does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1992 05/12/08 11:29:08 stewart@stripped +2 -0 Add utility to print the contents of the FragList file. Needed to help find a bug. Should be useful in the future (at least as a bit of documentation on the FragList file format). ndb/src/kernel/blocks/dbdih/printFragList.cpp 1.1 05/12/08 11:29:04 stewart@stripped +169 -0 New BitKeeper file ``ndb/src/kernel/blocks/dbdih/printFragList.cpp'' ndb/src/kernel/blocks/dbdih/printFragList.cpp 1.0 05/12/08 11:29:04 stewart@stripped +0 -0 BitKeeper file /home/stewart/Documents/MySQL/5.0/printFragList/ndb/src/kernel/blocks/dbdih/printFragList.cpp ndb/src/kernel/blocks/dbdih/Makefile.am 1.5 05/12/08 11:29:04 stewart@stripped +2 -1 Add rules to build ndbd_fraglist_reader when asked to # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: stewart # Host: willster.(none) # Root: /home/stewart/Documents/MySQL/5.0/printFragList --- New file --- +++ ndb/src/kernel/blocks/dbdih/printFragList.cpp 05/12/08 11:29:04 #include #include #include #include void usage(const char * prg){ ndbout << "Usage " << prg << " P[0-1].FragList" << endl; } struct page __attribute__ ((__packed__)){ Uint32 padding[32]; Uint32 data[480]; }; struct fraglist_header __attribute__ ((__packed__)){ Uint32 padding[3]; Uint32 totalFragments; Uint32 noOfBackups; Uint32 hashpointer; Uint32 kvalue; Uint32 mask; Uint32 type; Uint32 storedTable; }; struct fragment __attribute__ ((__packed__)){ Uint32 fid; Uint32 preferredPrimary; Uint32 noStoredReplicas; Uint32 noOldStoredReplicas; Uint32 distKey; // noStoredReplicas of struct replica // noOldStoredReplicas of struct replica }; struct replica __attribute__ ((__packed__)){ Uint32 procNode; Uint32 initialGci; Uint32 noCrashedReplicas; Uint32 nextLcp; struct lcp __attribute__ ((__packed__)){ Uint32 maxGciCompleted; Uint32 maxGciStarted; Uint32 lcpId; Uint32 lcpStatus; } lcp[3]; struct crashed_replicas __attribute__ ((__packed__)){ Uint32 createGci; Uint32 replicaLastGci; } crashed_replicas[8]; // those >= noCrashedReplicas are not initialized }; Uint32 readPageWord(FILE *f) { static struct page p; static Uint32 where= sizeof(struct page); if(where >= sizeof(p.data)) { // read next page Uint32 sz = fread(&p, 1, sizeof(struct page), f); if(sz != sizeof(struct page)) { ndbout << "Unable to read complete page (only read " << sz << " bytes instead of " << sizeof(struct page) << " bytes). File is corrupt. " << endl; exit(1); } ndbout << " *** READ NEW PAGE *** " << endl; where= 0; } return p.data[where++]; } void print(FILE *f) { Uint32 i, k; struct fraglist_header flh; struct fragment frag; // read the fraglist header; for(i=0;i