NDB Kernel Internals
The NDB Kernel (ndbd - found in storage/ndb/src/kernel) is divided into modules (blocks - storage/ndb/src/kernel/blocks). In 5.1, the blocks are:
- BACKUP - backup/ - responsible for taking BACKUPs and LCP
- CMVMI - cmvmi/ - Cluster Manager Virtual Machine Interface. Low level block providing access to the "virtual machine" (the execution of signals).
- DBACC - dbacc/ - ACCess Control. Locks and stuff.
- DBDICT - dbdict/ - DataBase DICTionary. CREATE/DROP TABLE/TABLESPACE/FILES
- DBDIH - dbdih/ - DataBase DIstribution Handler. Responsible for managing distribution in the cluster, checking if enough nodes alive to continue etc.
- DBLQH - dblqh/ - Local Query Handler. Non-distributed handling of queries
- DBTC - dbtc/ - Transaction Coordinator
- DBTUP - dbtup/ - TUPle manager
- DBTUX - dbtux/ - TUple indeX
- DBUTIL - dbutil/ - some UTILities to use when coding in the kernel - e.g. nice DB interface.
- LGMAN - lgman.cpp - LoG MANager. New in 5.1 for disk data
- NBCNTR - ndbcntr/ - Network DataBase CoNTRoller. starts/stops NDB. Start Phase foo.
- NDBFS - ndbfs/ - Network DataBase File System abstraction. interfaces to files on disk.
- PGMAN - pgman.cpp - PaGe MANager
- QMGR - qmgr/ - Quorum ManaGeR. Manages heartbeats and quorum. Originally this was Cluster Manager, but the guy developing it thought that Q sounded very much like Cluster (as in, Qluster). Form your own opinion.
- RESTORE - restore.cpp - RESTORE data from disk back into memory.
- SUMA - suma/ - SUbscription MAnager. Used to subscribe to events - only useful in 5.1 for replication
- TRIX - trix/ - TRiggers and IndeX manager. In cooperation with DBDICT
- TSMAN - tsman.cpp - TableSpace MANager. data files, undo files.
NOTE: Even though we talk about a "virtual machine" - NDB is not an interpreted environment like a JavaVM. It's native code. The VM we talk about is the infrastructure of executing signals, sending signals and stuff like that. As a programmer you get a "machine" that is made up of lots of nodes you can send signals to.
[edit] Error Injection
There is the ability to inject errors into a NDB node to simulate various failure scenarios. Autotest uses this extensively.
- Adding an Error Injection - a HOWTO