@@ -60,13 +60,16 @@ void __ditry_seqmode_fix(index_item_t *source, off_t original) {
6060 if (zdb_rootsettings .mode != ZDB_MODE_SEQUENTIAL && zdb_rootsettings .mode != ZDB_MODE_DIRECT_KEY )
6161 return ;
6262
63+ // hotfix
64+ return ;
65+
6366 // compute previous offset
64- // since sequential keys are hardcoded to be 4 bytes , we can easily
67+ // since sequential keys are hardcoded, we can easily
6568 // compute previous offset and ignoring value in the file
6669 //
6770 // this value were incorrect in some early version
6871 //
69- source -> previous = original - sizeof (index_item_t ) - sizeof (uint32_t );
72+ source -> previous = original - sizeof (index_item_t ) - sizeof (seqid_t );
7073
7174 if (source -> previous == sizeof (index_header_t ))
7275 source -> previous = 1 ;
@@ -76,12 +79,14 @@ void __ditry_seqmode_fix(index_item_t *source, off_t original) {
7679static index_scan_t index_previous_header_real (index_scan_t scan ) {
7780 index_item_t source ;
7881
82+ #if 0
7983 // special dirty-fix case, please see __ditry_seqmode_fix function
8084 if (scan .target == 1 ) {
8185 // forcing last entry position
8286 scan .target = lseek (scan .fd , 0 , SEEK_END );
8387 scan .target -= sizeof (index_item_t ) + sizeof (uint32_t );
8488 }
89+ #endif
8590
8691 // if scan.target is not set yet, we don't know the expected
8792 // offset of the previous header, let's read the header
@@ -94,11 +99,12 @@ static index_scan_t index_previous_header_real(index_scan_t scan) {
9499 return index_scan_error (scan , INDEX_SCAN_UNEXPECTED );
95100 }
96101
97- __ditry_seqmode_fix (& source , scan .original );
102+ // __ditry_seqmode_fix(&source, scan.original);
98103 index_item_header_dump (& source );
99104
100105 if (source .previous >= current ) {
101106 zdb_debug ("[+] index rscan: previous-header: previous offset (%u) in previous file\n" , source .previous );
107+ scan .target = source .previous ;
102108 return index_scan_error (scan , INDEX_SCAN_REQUEST_PREVIOUS );
103109 }
104110
@@ -117,11 +123,13 @@ static index_scan_t index_previous_header_real(index_scan_t scan) {
117123 return index_scan_error (scan , INDEX_SCAN_NO_MORE_DATA );
118124 }
119125
126+ #if 0
120127 // special dirty-fix case, please see __ditry_seqmode_fix function
121128 if (scan .target == 1 ) {
122129 scan .target = 0 ;
123130 return index_scan_error (scan , INDEX_SCAN_REQUEST_PREVIOUS );
124131 }
132+ #endif
125133
126134 // jumping to previous object
127135 lseek (scan .fd , scan .target , SEEK_SET );
@@ -132,7 +140,7 @@ static index_scan_t index_previous_header_real(index_scan_t scan) {
132140 return index_scan_error (scan , INDEX_SCAN_UNEXPECTED );
133141 }
134142
135- __ditry_seqmode_fix (& source , scan .target );
143+ // __ditry_seqmode_fix(&source, scan.target);
136144
137145 // checking if entry is deleted
138146 if (source .flags & INDEX_ENTRY_DELETED ) {
0 commit comments