# Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation.  The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA

Next QMGR 950
Next NDBCNTR 1023
Next NDBFS 2002
Next DBACC 3002
Next DBTUP 4039
Next DBLQH 5091
Next DBDICT 6223
Next DBDIH 7249
Next DBTC 8109
Next CMVMI 9000
Next BACKUP 10042
Next PGMAN 11010
Next DBTUX 12010
Next SUMA 13052
Next LGMAN 15002
Next TSMAN 16002
Next DBSPJ 17000
Next TRIX 18000
Next DBUTIL 19001

TESTING NODE FAILURE, ARBITRATION
---------------------------------

911 - 919:
Crash president when he starts to run in ArbitState 1-9.

910: Crash new president after node crash

934 : Crash president in ALLOC_NODE_ID_REQ

935 : Crash master on node failure (delayed) 
      and skip sending GSN_COMMIT_FAILREQ to specified node

938 : Resume communications (DUMP 9991) when > 25% nodes failed

ERROR CODES FOR TESTING NODE FAILURE, GLOBAL CHECKPOINT HANDLING:
-----------------------------------------------------------------

7000:
Insert system error in master when global checkpoint is idle.

7001:
Insert system error in master after receiving GCP_PREPARE from
all nodes in the cluster.

7002:
Insert system error in master after receiving GCP_NODEFINISH from
all nodes in the cluster.

7003:
Insert system error in master after receiving GCP_SAVECONF from
all nodes in the cluster.

7004:
Insert system error in master after completing global checkpoint with
all nodes in the cluster.

7186:
Master: Dont send GCP_PREPARE to all node(s)...and die after 1s

7187:
Master: Dont send GCP_COMMIT to all node(s)...and die after 1s

7188:
Master: Dont send GCP_SAVE_REQ to all node(s)...and die after 1s

7189:
Master: Dont send COPY_GCIREQ (GCP) to all node(s)...and die after 1s

7190:
Master Dont send SUB_GCP_COMPLETE_REP to all node(s) and dies after 1s

7005:
Insert system error in GCP participant when receiving GCP_PREPARE.

7006:
Insert system error in GCP participant when receiving GCP_COMMIT.

7007:
Insert system error in GCP participant when receiving GCP_TCFINISHED.

7008:
Insert system error in GCP participant when receiving COPY_GCICONF.

5000:
Insert system error in GCP participant when receiving GCP_SAVEREQ.

5007:
Delay GCP_SAVEREQ by 10 secs

5090:
Delay opening next redo log file.

7165: Delay INCL_NODE_REQ in starting node yeilding error in GCP_PREPARE

7030: Delay in GCP_PREPARE until node has completed a node failure
7031: Delay in GCP_PREPARE and die 3s later

7177: Delay copying of sysfileData in execCOPY_GCIREQ

7180: Crash master during master-take-over in execMASTER_LCPCONF

7183: Crash when receiving COPY_GCIREQ

7184: Crash before starting next GCP after a node failure

7185: Dont reply to COPY_GCI_REQ where reason == GCP

7193: Dont send LCP_FRAG_ORD to self, and crash when sending first
      LCP_FRAG_ORD(last)

7194: Force removeNodeFromStored to complete in the middle of MASTER_LCPCONF

Following are used to test GCP Monitor and take an extra argument
which default to 0, but if 1 will disable 'normal' handling of
GCP Stop so that isolation is required to remove a node.

7241: Delay COPY_GCIREQ processing indefinitely
7242: No initiation of GCP_COMMIT from Master
7243: No initiation of GCP_SAVE_REQ from Master
7237: Delay GCP_SAVEREQ processing indefinitely
7238: Delay GCP_PREPARE processing indefinitely
7239: Delay GCP_COMMIT processing indefinitely
7244: Delay SUB_GCP_COMPLETE_REP processing indefinitely
7247: Delay WAIT_GCP_REQ processing indefinitely
7248: Skip most recent LCP during a restart

Related (LQH):
  5085 : Ignore request to kill via DUMP 2305
  5087 : Treat request to kill via DUMP 2305 as CRASH_INSERTION
         (expected way for testcase to kill node)

Related (NDBCNTR)
  1004 : Ignore SYSTEM_ERROR for GCP Stop
  1005 : Treat SYSTEM_ERROR for GCP Stop as CRASH_INSERTION
         (expected way for testcase to kill node)

Related (QMGR)
  942  : Test 'forced isolation' (ISOLATE_ORD) by other nodes
         - Ignore ISOLATE_ORD signals
         - Ignore FAIL_REP signals for us with forced-isolation cause
         - Treat DISCONNECT_REP of others as CRASH_INSERTION

ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING:
-----------------------------------------------------------------

7009:
Insert system error in master when local checkpoint is idle.

7010:
Insert system error in master when local checkpoint is in the
state clcpStatus = CALCULATE_KEEP_GCI.

7011:
Stop local checkpoint in the state CALCULATE_KEEP_GCI.

7012:
Restart local checkpoint after stopping in CALCULATE_KEEP_GCI.

Method:
1) Error 7011 in master, wait until report of stopped.
2) Error xxxx in participant to crash it.
3) Error 7012 in master to start again.

7013:
Insert system error in master when local checkpoint is in the
state clcpStatus = COPY_GCI before sending COPY_GCIREQ.

7014:
Insert system error in master when local checkpoint is in the
state clcpStatus = TC_CLOPSIZE before sending TC_CLOPSIZEREQ.

7015:
Insert system error in master when local checkpoint is in the
state clcpStatus = START_LCP_ROUND before sending START_LCP_ROUND.

7016:
Insert system error in master when local checkpoint is in the
state clcpStatus = START_LCP_ROUND after receiving LCP_REPORT.

7017:
Insert system error in master when local checkpoint is in the
state clcpStatus = TAB_COMPLETED.

7018:
Insert system error in master when local checkpoint is in the
state clcpStatus = TAB_SAVED before sending DIH_LCPCOMPLETE.

7019:
Insert system error in master when local checkpoint is in the
state clcpStatus = IDLE before sending CONTINUEB(ZCHECK_TC_COUNTER).

7020:
Insert system error in local checkpoint participant at reception of
COPY_GCIREQ.

7075: Master
Don't send any LCP_FRAG_ORD(last=true)
And crash when all have "not" been sent

8000: Crash particpant when receiving TCGETOPSIZEREQ
8001: Crash particpant when receiving TC_CLOPSIZEREQ
5010: Crash any when receiving LCP_FRAGORD

7021: Crash in  master when receiving START_LCP_REQ
7022: Crash in !master when receiving START_LCP_REQ

7023: Crash in  master when sending START_LCP_CONF
7024: Crash in !master when sending START_LCP_CONF

7025: Crash in  master when receiving LCP_FRAG_REP
7016: Crash in !master when receiving LCP_FRAG_REP

7026: Crash in  master when changing state to LCP_TAB_COMPLETED 
7017: Crash in !master when changing state to LCP_TAB_COMPLETED 

7027: Crash in  master when changing state to LCP_TAB_SAVED
7018: Crash in  master when changing state to LCP_TAB_SAVED

7191: Crash when receiving LCP_COMPLETE_REP
7192: Crash in setLcpActiveStatusStart - when dead node missed to LCP's

7213: in GCP_COMMIT Kill specified node and self, stop processing
7214: in GCP_TCFINISHED kill specified node

7215: set c_fragments_per_node = 1 (needs to be done at startup)

7236: while doing LCP init, delay the last CONTINUEB with ZINIT_LCP so
      that all the tables are TLS_ACTIVE but the global c_lcpStatus.lcpState 
      is not yet changed from LCP_INIT_TABLES to LCP_STATUS_ACTIVE. 

LQH
5086: Ignore DUMP 2309, used by LCP Scan Frag watchdog to kill process

QMGR
942:  (See above) 
946:  Make node inactive for 180s during node restart, which results in missed
      heartbeats when HeartbeatIntervalDbDb is set to around 40s or lesser and
      TimeBetweenWatchDogCheck is set to its max. value (to prevent termination
      due to watchdog timeout)
      Steps to make, say, data node 2 miss heartbeats:
      1) Start cluster
      2) ndb_mgm -e "all restart -n"
      3) ndb_mgm -e "2 error 946"
      4) ndb_mgm -e "all start"
947:  Treat restart error due to a node disconnection as CRASH_INSERTION.
948:  Cause node to crash when first hearing of a node failure
949:  Pause before enabling this node to accept connections from API nodes

ERROR CODES FOR TESTING NODE FAILURE, FAILURE IN COPY FRAGMENT PROCESS:
-----------------------------------------------------------------------

5002:
Insert node failure in starting node when receiving a tuple copied from the copy node
as part of copy fragment process.
5003:
Insert node failure when receiving ABORT signal.

5004:
Insert node failure handling when receiving COMMITREQ.

5005:
Insert node failure handling when receiving COMPLETEREQ.

5006:
Insert node failure handling when receiving ABORTREQ.

5042:
As 5002, but with specified table (see DumpStateOrd)

These error code can be combined with error codes for testing time-out
handling in DBTC to ensure that node failures are also well handled in
time-out handling. They can also be used to test multiple node failure
handling.

5045: Crash in PREPARE_COPY_FRAG_REQ
5046: Crash if LQHKEYREQ (NrCopy) comes when frag-state is incorrect

ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBLQH
-------------------------------------------------
5011:
Delay execution of COMMIT signal 2 seconds to generate time-out.

5012 (use 5017):
First delay execution of COMMIT signal 2 seconds to generate COMMITREQ.
Delay execution of COMMITREQ signal 2 seconds to generate time-out.

5013:
Delay execution of COMPLETE signal 2 seconds to generate time-out.

5014 (use 5018):
First delay execution of COMPLETE signal 2 seconds to generate COMPLETEREQ.
Delay execution of COMPLETEREQ signal 2 seconds to generate time-out.

5015:
Delay execution of ABORT signal 2 seconds to generate time-out.

5016: (ABORTREQ only as part of take-over)
Delay execution of ABORTREQ signal 2 seconds to generate time-out.

5031: lqhKeyRef, ZNO_TC_CONNECT_ERROR
5032: lqhKeyRef, simulate a temporary redo error ZTEMPORARY_REDO_LOG_FAILURE
5033: lqhKeyRef, ZTAIL_PROBLEM_IN_LOG_ERROR

5034: Don't pop scan queue

5035: Delay ACC_CONTOPCONT

5038: Drop LQHKEYREQ + set 5039
5039: Drop ABORT + set 5003

8048: Make TC not choose own node for simple/dirty read
5041: Crash is receiving simple read from other TC on different node

8050: Send TCKEYREF is operation is non local
8071: Send TCKEYREF is unique index operation is non local
8072: 8050 || 8071

5100,5101: Drop ABORT req in primary replica
           Crash on "next" ABORT

5047: ZTRANSPORTER_OVERLOADED_ERROR in execLQHKEYREQ

ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC
-------------------------------------------------
8040:
Delay execution of ABORTED signal 2 seconds to generate time-out.

8041:
Delay execution of COMMITTED signal 2 seconds to generate time-out.
8042 (use 8046):
Delay execution of COMMITTED signal 2 seconds to generate COMMITCONF.
Delay execution of COMMITCONF signal 2 seconds to generate time-out.

8043:
Delay execution of COMPLETED signal 2 seconds to generate time-out.

8044 (use 8047):
Delay execution of COMPLETED signal 2 seconds to generate COMPLETECONF.
Delay execution of COMPLETECONF signal 2 seconds to generate time-out.

8045: (ABORTCONF only as part of take-over)
Delay execution of ABORTCONF signal 2 seconds to generate time-out.

8080: Send ZABORT_TIMEOUT_BREAK delayed

8053: Crash in timeOutFoundLab, state CS_WAIT_COMMIT_CONF

8054: Throw away TC_KEYCONF to api and die 5 seconds later.  To test commit ack markers
5048: Crash in execCOMMIT
5049: SET_ERROR_INSERT_VALUE(5048)

ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC
-------------------------------------------------

8003: Throw away a LQHKEYCONF in state STARTED
8004: Throw away a LQHKEYCONF in state RECEIVING
8005: Throw away a LQHKEYCONF in state REC_COMMITTING
8006: Throw away a LQHKEYCONF in state START_COMMITTING

8007: Ignore send of LQHKEYREQ in state STARTED
8008: Ignore send of LQHKEYREQ in state START_COMMITTING

8009: Ignore send of LQHKEYREQ+ATTRINFO in state STARTED
8010: Ignore send of LQHKEYREQ+ATTRINFO in state START_COMMITTING

8011: Abort at send of CONTINUEB(ZSEND_ATTRINFO) in state STARTED
8012: Abort at send of CONTINUEB(ZSEND_ATTRINFO) in state START_COMMITTING

8013: Ignore send of CONTINUEB(ZSEND_COMPLETE_LOOP) (should crash eventually)
8014: Ignore send of CONTINUEB(ZSEND_COMMIT_LOOP) (should crash eventually)

8015: Ignore ATTRINFO signal in DBTC in state REC_COMMITTING
8016: Ignore ATTRINFO signal in DBTC in state RECEIVING

8017: Return immediately from DIVERIFYCONF (should crash eventually)
8018: Throw away a COMMITTED signal
8019: Throw away a COMPLETED signal

ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTUP
--------------------------------------------------
4035: Randomly add a random delay to disk data access
4037: Delay TRANSID_AI while sending packed result to API 
4038: Delay data-node internal TRANSID_AI send for 10 millis

TESTING TAKE-OVER FUNCTIONALITY IN DBTC
---------------------------------------

8002: Crash when sending LQHKEYREQ
8029: Crash when receiving LQHKEYCONF
8030: Crash when receiving COMMITTED
8031: Crash when receiving COMPLETED
8020: Crash when all COMMITTED has arrived
8021: Crash when all COMPLETED has arrived
8022: Crash when all LQHKEYCONF has arrived

COMBINATION OF TIME-OUT + CRASH
-------------------------------

8023 (use 8024): Ignore LQHKEYCONF and crash when ABORTED signal arrives by setting 8024
8025 (use 8026): Ignore COMMITTED and crash when COMMITCONF signal arrives by setting 8026
8027 (use 8028): Ignore COMPLETED and crash when COMPLETECONF signal arrives by setting 8028

ABORT OF TCKEYREQ
-----------------

8032: No free TC records any more

8037 : Invalid schema version in TCINDXREQ

------

8038 : Simulate API disconnect just after SCAN_TAB_REQ

8055 : Crash in sendApiCommit, disconnect API, and set 8056
8056 : return directly in API_FAILREQ
8057 : Send only 1 COMMIT per timeslice

8052 : Simulate failure of TransactionBufferMemory allocation for OI lookup

8051 : Simulate failure of allocation for saveINDXKEYINFO
8078 : Activate error insert 8079 on receiving API_FAILREQ
8079 : Crash if TCKEYREQ received from failed api

DBTC LONG SIGNAL TESTING
------------------------
8065: Consume all but 10 long section segments on next TCKEYREQ
8066: Consume all but 1 long section segments on next TCKEYREQ
8067: Consume all long section segments on next TCKEYREQ
8068: Free all segments hoarded by 8065, 8066, 8067

8069: Always send 'short' LQHKEYREQ to LQH
8070: Always send 'short' SCANFRAGREQ to LQH

8074: Drop first fragment of fragmented SCANTABREQ
8075: Drop middle fragments of fragmented SCANTABREQ
8076: Drop last fragment of fragmented SCANTABREQ
8077: Drop all fragments of fragmented SCANTABREQ

8085: Simulate execFIRE_TRIG_ORD DataBuffer exhaustion
8086: Simulate execFIRE_TRIG_ORD segmented section exhaustion

8087: Simulate commit ack marker exhaustion
8096: Simulate commit ack marker databuffer exhaustion

DBLQH LONG SIGNAL TESTING
-------------------------
5051: Send short LQHKEYREQ to next replica
5052: Fail to store KeyInfo from TUP in long section

DBTC TCINDXREQ TESTING
----------------------

8100: Force TCINDXREQ to recycle a connection record of ongoing abort, phase 1 (set by test case). Will block TCROLLBACKREP.

8101: Force TCINDXREQ to recycle a connection record of ongoing abort, phase 2 (set internally). Will release TCROLLBACKREP.

8102: simulate out of memory (segments,attributes) in fk_scanFromChildTable
8103: simulate out of memory in fk_constructAttrInfoUpdateCascade
8104: simulate ZGET_DATAREC_ERROR (218) in fk_buildKeyInfo
8105: prevent fix (bugXXX) to failed trigger op handling
8106: simulate out of memory in fk_constructAttrInfoSetNull
8107: Cause transaction abort with timeout error

8108: Cause transaction timeout (error 4012) by failing to send TC_COMMITCONF

CMVMI
-----
9000 Set RestartOnErrorInsert to restart -n
9998 Enter endless loop (trigger watchdog)
9999 Crash system immediatly

Test Crashes in handling node restarts
--------------------------------------

7121: Crash after receiving permission to start (START_PERMCONF) in starting
      node.
7122: Crash master when receiving request for permission to start (START_PERMREQ).
7123: Crash any non-starting node when receiving information about a starting node
      (START_INFOREQ)
7124: Respond negatively on an info request (START_INFOREQ)
7125: Stop an invalidate Node LCP process in the middle to test if START_INFOREQ
      stopped by long-running processes are handled in a correct manner.
7126: Allow node restarts for all nodes (used in conjunction with 7025)
7127: Crash when receiving a INCL_NODEREQ message.
7128: Crash master after receiving all INCL_NODECONF from all nodes
7129: Crash master after receiving all INCL_NODECONF from all nodes and releasing
      the lock on the dictionary
7130: Crash starting node after receiving START_MECONF
7131: Crash when receiving START_COPYREQ in master node
7132: Crash when receiving START_COPYCONF in starting node

7170: Crash when receiving START_PERMREF (InitialStartRequired)

8039: DBTC delay INCL_NODECONF and kill starting node

7174: Crash starting node before sending DICT_LOCK_REQ
7175: Master sends one fake START_PERMREF (ZNODE_ALREADY_STARTING_ERROR)
7176: Slave NR pretends master does not support DICT lock (rolling upgrade)

DICT:
6000  Crash during NR when receiving DICTSTARTREQ
6001  Crash during NR when receiving SCHEMA_INFO
6002  Crash during NR soon after sending GET_TABINFO_REQ

LQH:
5026  Crash when receiving COPY_ACTIVEREQ
5027  Crash when receiving STAT_RECREQ

5043  Crash starting node, when scan is finished on primary replica

Test Crashes in handling take over
----------------------------------

7133: Crash when receiving START_TOREQ
7134: Crash master after receiving all START_TOCONF
7135: Crash master after copying table 0 to starting node
7136: Crash master after completing copy of tables
7137: Crash master after adding a fragment before copying it
7138: Crash when receiving UPDATE_FRAG_STATEREQ in prepare phase
7139: Crash when receiving UPDATE_FRAG_STATEREQ in commit phase
7140: Crash master when receiving all UPDATE_FRAG_STATECONF in prepare phase
7141: Crash master when receiving all UPDATE_FRAG_STATECONF in commit phase
7142: Crash master when receiving COPY_FRAGCONF
7143: Crash master when receiving COPY_ACTIVECONF
7144: Crash when receiving END_TOREQ
7145: Crash master after receiving first END_TOCONF
7146: Crash master after receiving all END_TOCONF
7147: Crash master after receiving first START_TOCONF
7148: Crash master after receiving first UPDATE_FRAG_STATECONF
7152: Crash master after receiving first UPDATE_TOCONF
7153: Crash master after receiving all UPDATE_TOCONF
7154: Crash when receiving UPDATE_TOREQ
7155: Crash master when completing writing start take over info
7156: Crash master when completing writing end take over info

Test failures in various states in take over functionality
----------------------------------------------------------
7157: Block take over at start take over
7158: Block take over at sending of START_TOREQ
7159: Block take over at selecting next fragment
7160: Block take over at creating new fragment
7161: Block take over at sending of UPDATE_FRAG_STATEREQ in prepare phase
7162: Block take over at sending of UPDATE_FRAG_STATEREQ in commit phase
7163: Block take over at sending of UPDATE_TOREQ at end of copy frag
7164: Block take over at sending of END_TOREQ
7169: Block take over at sending of UPDATE_TOREQ at end of copy

5008: Crash at reception of EMPTY_LCPREQ (at master take over after NF)
5009: Crash at sending of EMPTY_LCPCONF (at master take over after NF)

Test Crashes in Handling Graceful Shutdown
------------------------------------------
7065: Crash when receiving STOP_PERMREQ in master
7066: Crash when receiving STOP_PERMREQ in slave
7067: Crash when receiving DIH_SWITCH_REPLICA_REQ
7068: Crash when receiving DIH_SWITCH_REPLICA_CONF


Backup Stuff:
------------------------------------------
10001: Crash on NODE_FAILREP in Backup coordinator
10002: Crash on NODE_FAILREP when coordinatorTakeOver
10003: Crash on PREP_CREATE_TRIG_{CONF/REF} (only coordinator)
10004: Crash on START_BACKUP_{CONF/REF} (only coordinator)
10005: Crash on CREATE_TRIG_{CONF/REF} (only coordinator)
10006: Crash on WAIT_GCP_REF (only coordinator)
10007: Crash on WAIT_GCP_CONF (only coordinator)
10008: Crash on WAIT_GCP_CONF during start of backup (only coordinator)
10009: Crash on WAIT_GCP_CONF during stop of backup (only coordinator)
10010: Crash on BACKUP_FRAGMENT_CONF (only coordinator)
10011: Crash on BACKUP_FRAGMENT_REF (only coordinator)
10012: Crash on DROP_TRIG_{CONF/REF} (only coordinator)
10013: Crash on STOP_BACKUP_{CONF/REF} (only coordinator)
10014: Crash on DEFINE_BACKUP_REQ (participant)
10015: Crash on START_BACKUP_REQ (participant)
10016: Crash on BACKUP_FRAGMENT_REQ (participant)
10017: Crash on SCAN_FRAGCONF (participant)
10018: Crash on FSAPPENDCONF (participant)
10019: Crash on TRIG_ATTRINFO (participant)
10020: Crash on STOP_BACKUP_REQ (participant)
10021: Crash on NODE_FAILREP in participant not becoming coordinator

10022: Fake no backup records at DEFINE_BACKUP_REQ (participant)
10023: Abort backup by error at reception of UTIL_SEQUENCE_CONF (code 300)
10024: Abort backup by error at reception of DEFINE_BACKUP_CONF (code 301)
10025: Abort backup by error at reception of CREATE_TRIG_CONF last (code 302)
10026: Abort backup by error at reception of START_BACKUP_CONF (code 303)
10027: Abort backup by error at reception of DEFINE_BACKUP_REQ at master (code 304)
10028: Abort backup by error at reception of BACKUP_FRAGMENT_CONF at master (code 305)
10029: Abort backup by error at reception of FSAPPENDCONF in slave (FileOrScanError = 5)
10030: Simulate buffer full from trigger execution => abort backup
10031: Error 331 for dictCommitTableMutex_locked
10032: backup checkscan
10033: backup checkscan
10034: define backup reply error
10035: Fail to allocate buffers

10039: Halt backup for table >= 2
10040: Resume backup (from 10039)
10038: Receive abort backup in the middle of locking tables.
10041: delay backup after create trigger. for testing undo log file.

11001: Send UTIL_SEQUENCE_REF (in master)

5028:  Crash when receiving LQHKEYREQ (in non-master)

Failed Create Table:
--------------------
7173: Create table failed due to not sufficient number of fragment or
      replica records.
3001: Fail create 1st fragment
4007 12001: Fail create 1st fragment
4008 12002: Fail create 2nd fragment
4009 12003: Fail create 1st attribute in 1st fragment
4010 12004: Fail create last attribute in 1st fragment
4011 12005: Fail create 1st attribute in 2nd fragment
4012 12006: Fail create last attribute in 2nd fragment
4032 : Fail to receive first default value
4033 : Fail to receive last default value
4034 : Fail to store default values in def values fragment

Drop Table/Index:
-----------------
4001: Crash on REL_TABMEMREQ in TUP
4002: Crash on DROP_TABFILEREQ in TUP
4003: Fail next trigger create in TUP
4004: Fail next trigger drop in TUP
8033: Fail next trigger create in TC
8034: Fail next index create in TC
8035: Fail next trigger drop in TC
8036: Fail next index drop in TC
6006: Crash participant in create index

4013: verify TUP tab descr before and after next DROP TABLE

Dict transactions
-----------------

These should be applied separately to master and slave.
CTa = create table, ATr = alter trigger, and so on

6101: Fail seize of schema trans (err=780)
6102: Kill api (client) at SCHEMA_TRANS_BEGIN_REQ (err=4009)
6103: Delay SCHEMA_TRANS_IMPL_CONF (1000ms)

6111: Fail seize of schema op (err=783) in CTa, DTa, ATa
6112: Fail seize of schema op (err=783) in CIn, DIn
6113: Fail seize of schema op (err=783) in AIn
6114: Fail seize of schema op (err=783) in CTr, DTr
6115: Fail seize of schema op (err=783) in ATr
6116: Fail seize of schema op (err=783) in BIn

6121: Fail parse (err=9121) in CTa, DTa, ATa
6122: Fail parse (err=9122) in CIn, DIn
6123: Fail parse (err=9123) in AIn
6124: Fail parse (err=9124) in CTr, DTr
6125: Fail parse (err=9125) in ATr
6126: Fail parse (err=9126) in BIn

6131: Fail prepare (err=9131) in CTa, DTa, ATa

# these have no natural failures in DBDICT
# use 8033, 4003, 8034 instead
#6132: Fail prepare (err=9132) in CIn, DIn
#6133: Fail prepare (err=9133) in AIn
#6134: Fail prepare (err=9134) in CTr, DTr
#6135: Fail prepare (err=9135) in ATr
#6136: Fail prepare (err=9136) in BIn

# Master failure, partial progress 
6140: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_START
6141: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_PARSE
6142: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_FLUSH_PREPARE
6143: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_PREPARE
6144: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_ABORT_PARSE
6145: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_ABORT_PREPARE
6146: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_FLUSH_COMMIT
6147: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_COMMIT
6148: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_FLUSH_COMPLETE
6149: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_COMPLETE
6150: Tell master to skip last SCHEMA_TRANS_IMPL_REQ at RT_END

System Restart:
---------------

5020: Force system to read pages form file when executing prepare operation record
3000: Delay writing of datapages in ACC when LCP is started
4000: Delay writing of datapages in TUP when LCP is started
7070: Set TimeBetweenLcp to min value
7071: Set TimeBetweenLcp to max value
7072: Split START_FRAGREQ into several log nodes
7073: Don't include own node in START_FRAGREQ
7074: 7072 + 7073

Scan:
------

5021: Crash when receiving SCAN_NEXTREQ if sender is own node
5022: Crash when receiving SCAN_NEXTREQ if sender is NOT own node
5023: Drop SCAN_NEXTREQ if sender is own node
5024: Drop SCAN_NEXTREQ if sender is NOT own node
5025: Delay SCAN_NEXTREQ 1 second if sender is NOT own node
5030: Drop all SCAN_NEXTREQ until node is shutdown with SYSTEM_ERROR
      because of scan fragment timeout

Test routing of signals:
-----------------------
4006: Turn on routing of TRANSID_AI signals from TUP
5029: Turn on routing of KEYINFO20 signals from LQH

Ordered index:
--------------
12007: Make next alloc node fail with no memory error
12008: Fail seize scan op
12009: Cause InvalidBounds error

Dbdict:
-------
6003 Crash in participant @ CreateTabReq::Prepare
6004 Crash in participant @ CreateTabReq::Commit
6005 Crash in participant @ CreateTabReq::CreateDrop
6007 Fail on readTableFile for READ_TAB_FILE1 (28770)
6012 Bump up next table id to 4096
6013 Master failure during prepare
6014 Master failure during commit
6015 Master failure after commit

6022 Cluster failure before flush prepare
6021 Cluster failure before prepare first
6016
6017 Cluster failure before flush commit
6018 Cluster failure before commit first
6019 Cluster failure before flush complete
6020 Cluster failure before complete first

6030 Do not round DD sizes in DBDICT. Check in ndb*out.log
     that DBDICT and LGMAN/TSMAN round same way.

6200 Set error code after handleTabInfoInit in master
6201 Set error code after handleTabInfoInit in master (index)
6202 Set error code before CREATE_FRAGMENTATION in master
6203 Set error code before CREATE_FRAGMENTATION in master (index)

6215 Randomly fail GET_TABINFOREQ with Busy (no CLEAR_ERROR_INSERT_VALUE)
6216 Delay GET_TABINFOREQ processing indefinitely
6217 Delay CREATE_TABLE_REQ, ALTER_TABLE_REQ and DROP_TABLE_REQ processing indefinitely
6218 Delay CREATE_INDEX_REQ, CREATE_FILEGROUP_REQ, CREATE_FILE_REQ, CREATE_FK_REQ indefinitely
6219 Delay DROP_INDEX_REQ, DROP_FILEGROUP_REQ, DROP_FILE_REQ, DROP_FK_REQ processing indefinitely
6220 Delay LIST_TABLES_REQ indefinitely
6221 Delay INDEX_STAT_REQ indefinitely
6222 Delay CREATE_HASH_MAP_REQ indefinitely
6223 Only send SCHEMA_TRANS_IMPL_REQ to self preparatory to crashing

Dbtup:
4014 - handleInsert - Out of undo buffer
4015 - handleInsert - Out of log space
4016 - handleInsert - AI Inconsistency
4017 - handleInsert - Out of memory
4018 - handleInsert - Null check error
4019 - handleInsert - Alloc rowid error
4020 - handleInsert - Size change error
4021 - handleInsert - Out of disk space

4022 - addTuxEntries - fail before add of first entry
4023 - addTuxEntries - fail add of last entry (the entry for last index)

4025: Fail all inserts with out of memory
4026: Fail one insert with oom
4027: Fail inserts randomly with oom
4028: Fail one random insert with oom

NDBCNTR:

1000: Crash insertion on SystemError::CopyFragRef
1001: Delay sending NODE_FAILREP (to own node), until error is cleared

1022 : Increase system shutdown TC timeout by 5 seconds
1023 : Increase system shutdown TC timeout by 5 seconds
       Fail node rather than send WAIT_GCP_REQ
1024 : Increase system shutdown TC timeout by 5 seconds
       Fail master node concurrent with sending WAIT_GCP_REQ

SUMA:
13036: Simulate report MISSING_DATA at node failure
13037: Simulate disconnect lagging subscribers
13038: Simulate out of event buffer

13039: Crash i DICT_LOCKCONF
13040: Crash in SUB_CREATE_REQ if m_restart_server_node_id != RNIL
13041: Crash in SUB_CREATE_REQ (no matter)
13042: Crash in SUB_START_REQ (if m_restart_server_node_id != 0)
13051: Delay the DROP_TRIG_IMPL_REQ

LGMAN:
-----
15000: Fail to create log file CreateFileImplRef::FileSizeTooLarge
15001: Fail to create file group due to
       CreateFilegroupImplRef::OutOfLogBufferMemory

TSMAN:
-----
16000: Fail to create data file
16001: Fail to create file group due to
       CreateFilegroupImplRef::OutOfFilegroupRecords

ACC bug#34348
-------------
3002: limit frags to 2 directory pages (instead of 256)
      print (if VM_TRACE) LH variables at expand and shrink
      apply before mass data load, reset with error insert 0

TRIX
----
Index stats:
18001: fail to seize statOp
18002: fail to seize associated subRec
18011: fail HEAD read - simulate UtilExecuteRef::AllocationError
18012: fail HEAD insert/update/delete - as in 18011
18021: fail RT_CLEAN_NEW - simulate TC error 626
18022: fail RT_CLEAN_OLD (non-fatal) - as in 18021
18023: fail RT_CLEAN_ALL (non-fatal) - as in 18021
18024: fail RT_SCAN_FRAG - simulate TC error 630

DBUTIL
-------
19000: fail UTIL_PREPARE_REQ with PREPARE_SEIZE_ERROR
