@@ -142,22 +142,11 @@ private void openDatabase(Options dbOptions) throws IOException {
142
142
if (!Files .isSymbolicLink (dbPath .getParent ())) {
143
143
Files .createDirectories (dbPath .getParent ());
144
144
}
145
- try {
146
- database = factory .open (dbPath .toFile (), dbOptions );
147
- if (!this .getDBName ().startsWith ("checkpoint" )) {
148
- logger .info ("DB {} open success with writeBufferSize {} M, cacheSize {} M, maxOpenFiles {}." ,
149
- this .getDBName (), dbOptions .writeBufferSize () / 1024 / 1024 ,
150
- dbOptions .cacheSize () / 1024 / 1024 , dbOptions .maxOpenFiles ());
151
- }
152
- } catch (IOException e ) {
153
- if (e .getMessage ().contains ("Corruption:" )) {
154
- logger .warn ("DB {} corruption detected, try to repair it." , this .getDBName (), e );
155
- factory .repair (dbPath .toFile (), dbOptions );
156
- logger .warn ("DB {} corruption detected, repair done." , this .getDBName ());
157
- database = factory .open (dbPath .toFile (), dbOptions );
158
- } else {
159
- throw e ;
160
- }
145
+ database = factory .open (dbPath .toFile (), dbOptions );
146
+ if (!this .getDBName ().startsWith ("checkpoint" )) {
147
+ logger .info ("DB {} open success with writeBufferSize {} M, cacheSize {} M, maxOpenFiles {}." ,
148
+ this .getDBName (), dbOptions .writeBufferSize () / 1024 / 1024 ,
149
+ dbOptions .cacheSize () / 1024 / 1024 , dbOptions .maxOpenFiles ());
161
150
}
162
151
}
163
152
0 commit comments