22 #include <ndb_global.h>
25 #include <NdbTest.hpp>
26 #include <NDBT_Error.hpp>
30 ErrorData::ErrorData()
32 errorCountArray =
new Uint32[6000];
36 temporary_resource_error =
true;
37 insufficient_space_error =
false;
38 node_recovery_error =
true;
39 overload_error =
true;
41 internal_error =
true;
43 application_error =
false;
46 ErrorData::~ErrorData()
48 delete [] errorCountArray;
56 int ErrorData::handleErrorCommon(
const NdbError & error)
59 if (error.
code > 6000) {
60 if (user_error ==
true) {
65 errorCountArray[error.
code]++;
69 if (key_error ==
true) {
74 if (temporary_resource_error ==
true) {
79 if (insufficient_space_error ==
true) {
84 if (node_recovery_error ==
true) {
90 if(error.
code == 4012){
93 if(error.
code == 4115){
96 if(error.
code == 4007 && node_recovery_error ==
true){
101 if (overload_error ==
true) {
102 NdbSleep_MilliSleep(50);
107 if (timeout_error ==
true) {
112 if (internal_error ==
true) {
117 if (application_error ==
true) {
122 if (user_error ==
true) {
139 for (localLoop = 0; localLoop < 6000; localLoop++) {
140 int errCount = (int)errorCountArray[localLoop];
142 out <<
"NDBT: ErrorCode = " << localLoop <<
" occurred ";
143 out << errCount <<
" times" << endl;
151 out <<
"Key Errors are ";
152 if (key_error ==
false) {
153 out <<
"disallowed" << endl;
155 out <<
"allowed" << endl;
157 out <<
"Temporary Resource Errors are ";
158 if (temporary_resource_error ==
false) {
159 out <<
"disallowed" << endl;
161 out <<
"allowed" << endl;
163 if (internal_error ==
true) {
164 out <<
"Insufficient Space Errors are ";
166 if (insufficient_space_error ==
false) {
167 out <<
"disallowed" << endl;
169 out <<
"allowed" << endl;
171 out <<
"Node Recovery Errors are ";
172 if (node_recovery_error ==
false) {
173 out <<
"disallowed" << endl;
175 out <<
"allowed" << endl;
177 out <<
"Overload Errors are ";
178 if (overload_error ==
false) {
179 out <<
"disallowed" << endl;
181 out <<
"allowed" << endl;
183 out <<
"Timeout Errors are ";
184 if (timeout_error ==
false) {
185 out <<
"disallowed" << endl;
187 out <<
"allowed" << endl;
189 out <<
"Internal NDB Errors are ";
190 if (internal_error ==
false) {
191 out <<
"disallowed" << endl;
193 out <<
"allowed" << endl;
195 out <<
"User logic reported Errors are ";
196 if (user_error ==
false) {
197 out <<
"disallowed" << endl;
199 out <<
"allowed" << endl;
201 out <<
"Application Errors are ";
202 if (application_error ==
false) {
203 out <<
"disallowed" << endl;
205 out <<
"allowed" << endl;
212 out <<
" -key_err Allow key errors" << endl;
213 out <<
" -no_key_err Disallow key errors (default)" << endl;
214 out <<
" -temp_res_err Allow temporary resource errors (default)";
216 out <<
" -no_temp_res_err Disallow temporary resource errors" << endl;
217 out <<
" -ins_space_err Allow insufficient space errors" << endl;
218 out <<
" -no_ins_space_err Disallow insufficient space errors (default)";
220 out <<
" -noderec_err Allow Node Recovery errors (default)" << endl;
221 out <<
" -no_noderec_err Disallow Node Recovery errors" << endl;
222 out <<
" -overload_err Allow Overload errors (default)" << endl;
223 out <<
" -no_overload_err Disallow Overload errors" << endl;
224 out <<
" -timeout_err Allow Time-out errors (default)" << endl;
225 out <<
" -no_timeout_err Disallow Time-out errors" << endl;
226 out <<
" -internal_err Allow Internal NDB errors" << endl;
227 out <<
" -no_internal_err Disallow Internal NDB errors (default)";
228 out <<
" -user_err Allow user logic reported errors (default)";
230 out <<
" -no_user_err Disallow user logic reported errors";
238 bool ret_Value =
true;
239 if (strcmp(argv[i],
"-key_err") == 0){
241 }
else if (strcmp(argv[i],
"-no_key_err") == 0){
243 }
else if (strcmp(argv[i],
"-temp_res_err") == 0){
244 temporary_resource_error =
true;
245 }
else if (strcmp(argv[i],
"-no_temp_res_err") == 0){
246 temporary_resource_error =
false;
247 }
else if (strcmp(argv[i],
"-ins_space_err") == 0){
248 insufficient_space_error =
true;
249 }
else if (strcmp(argv[i],
"-no_ins_space_err") == 0){
250 insufficient_space_error =
false;
251 }
else if (strcmp(argv[i],
"-noderec_err") == 0){
252 node_recovery_error =
true;
253 }
else if (strcmp(argv[i],
"-no_noderec_err") == 0){
254 node_recovery_error =
false;
255 }
else if (strcmp(argv[i],
"-overload_err") == 0){
256 overload_error =
true;
257 }
else if (strcmp(argv[i],
"-no_overload_err") == 0){
258 overload_error =
false;
259 }
else if (strcmp(argv[i],
"-timeout_err") == 0){
260 timeout_error =
true;
261 }
else if (strcmp(argv[i],
"-no_timeout_err") == 0){
262 timeout_error =
false;
263 }
else if (strcmp(argv[i],
"-internal_err") == 0){
264 internal_error =
true;
265 }
else if (strcmp(argv[i],
"-no_internal_err") == 0){
266 internal_error =
false;
267 }
else if (strcmp(argv[i],
"-user_err") == 0){
269 }
else if (strcmp(argv[i],
"-no_user_err") == 0){
279 for (
int i = 0;
i < 6000;
i++){
280 errorCountArray[
i] = 0 ;