1
0
Fork 0

fixed datafile debugger

Conflicts:
	CHANGELOG
This commit is contained in:
Frank Celler 2014-06-17 09:21:38 +02:00
parent e6d6e25a7f
commit f794ee8368
5 changed files with 19 additions and 4 deletions

View File

@ -1,6 +1,8 @@
v2.2.0 (XXXX-XX-XX)
-------------------
* fixed datafile debugger
* fixed check-version for empty directory
* moved try/catch block to the top of routing chain

View File

@ -6016,6 +6016,7 @@ static v8::Handle<v8::Value> JS_DatafileScanVocbaseCol (v8::Arguments const& arg
o->Set(v8::String::New("position"), v8::Number::New(entry->_position));
o->Set(v8::String::New("size"), v8::Number::New(entry->_size));
o->Set(v8::String::New("realSize"), v8::Number::New(entry->_realSize));
o->Set(v8::String::New("tick"), V8TickId(entry->_tick));
o->Set(v8::String::New("type"), v8::Number::New((int) entry->_type));
o->Set(v8::String::New("status"), v8::Number::New((int) entry->_status));

View File

@ -443,6 +443,7 @@ static TRI_df_scan_t ScanDatafile (TRI_datafile_t const* datafile) {
entry._position = (TRI_voc_size_t) (ptr - datafile->_data);
entry._size = marker->_size;
entry._realSize = TRI_DF_ALIGN_BLOCK(marker->_size);
entry._tick = marker->_tick;
entry._type = marker->_type;
entry._status = 1;

View File

@ -220,11 +220,19 @@ TRI_df_scan_t;
////////////////////////////////////////////////////////////////////////////////
/// @brief scan result entry
///
/// status:
/// 1 - entry ok
/// 2 - empty entry
/// 3 - empty size
/// 4 - size too small
/// 5 - CRC failed
////////////////////////////////////////////////////////////////////////////////
typedef struct TRI_df_scan_entry_s {
TRI_voc_size_t _position;
TRI_voc_size_t _size;
TRI_voc_size_t _realSize;
TRI_voc_tick_t _tick;
TRI_df_marker_type_t _type;

View File

@ -138,7 +138,7 @@ function QueryWipeDatafile (collection, type, datafile, scan, lastGoodPos) {
var entry = entries[lastGoodPos];
WipeDatafile(collection, type, datafile, entry.position + entry.size);
WipeDatafile(collection, type, datafile, entry.position + entry.realSize);
}
////////////////////////////////////////////////////////////////////////////////
@ -180,7 +180,7 @@ function PrintEntries (entries, amount) {
case 5: s = "FAILED (crc mismatch)"; break;
}
printf(" %d: status %s type %d size %d, tick %s\n", i, s, entry.type, entry.size, entry.tick);
printf(" %d: status %s type %d size %d, tick %s\n", i, s, entry.type, entry.realSize, entry.tick);
}
}
@ -210,7 +210,7 @@ function DeepCheckDatafile (collection, type, datafile, scan) {
}
if (! stillGood) {
printf(" Last good position: %d\n", lastGood.position + lastGood.size);
printf(" Last good position: %d\n", lastGood.position + lastGood.realSize);
printf("\n");
QueryWipeDatafile(collection, type, datafile, scan, lastGoodPos);
@ -256,7 +256,7 @@ function CheckDatafile (collection, type, datafile, issues, details) {
break;
case 3:
statusMessage = "FATAL (reached corrupt marker)";
statusMessage = "FATAL (reached corrupted marker)";
color = internal.COLORS.COLOR_RED;
break;
@ -537,8 +537,10 @@ function main (argv) {
printf("Prints details (Y/N)? ");
var details = false;
while (true) {
line = console.getline();
if (line === "") {
printf("Exiting. Please wait.\n");
return;
@ -547,6 +549,7 @@ function main (argv) {
if (line === "yes" || line === "YES" || line === "y" || line === "Y") {
details = true;
}
break;
}