@@ -34,10 +34,10 @@ import org.apache.hadoop.fs.permission.FsAction
34
34
import org .apache .hadoop .hdfs .DistributedFileSystem
35
35
import org .apache .hadoop .hdfs .protocol .HdfsConstants
36
36
import org .apache .hadoop .security .AccessControlException
37
+ import org .fusesource .leveldbjni .internal .NativeDB
37
38
38
39
import org .apache .spark .{SecurityManager , SparkConf , SparkException }
39
40
import org .apache .spark .deploy .SparkHadoopUtil
40
- import org .apache .spark .deploy .history .config ._
41
41
import org .apache .spark .internal .Logging
42
42
import org .apache .spark .scheduler ._
43
43
import org .apache .spark .scheduler .ReplayListenerBus ._
@@ -132,15 +132,20 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
132
132
AppStatusStore .CURRENT_VERSION , logDir.toString())
133
133
134
134
try {
135
- open(new File (path, " listing.ldb " ) , metadata)
135
+ open(dbPath , metadata)
136
136
} catch {
137
137
// If there's an error, remove the listing database and any existing UI database
138
138
// from the store directory, since it's extremely likely that they'll all contain
139
139
// incompatible information.
140
140
case _ : UnsupportedStoreVersionException | _ : MetadataMismatchException =>
141
141
logInfo(" Detected incompatible DB versions, deleting..." )
142
142
path.listFiles().foreach(Utils .deleteRecursively)
143
- open(new File (path, " listing.ldb" ), metadata)
143
+ open(dbPath, metadata)
144
+ case dbExc : NativeDB .DBException =>
145
+ // Get rid of the corrupted listing.ldb and re-create it.
146
+ logWarning(s " Failed to load disk store $dbPath : " , dbExc)
147
+ Utils .deleteRecursively(dbPath)
148
+ open(dbPath, metadata)
144
149
}
145
150
}.getOrElse(new InMemoryStore ())
146
151
@@ -568,7 +573,6 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
568
573
}
569
574
570
575
val logPath = fileStatus.getPath()
571
- logInfo(s " Replaying log path: $logPath" )
572
576
573
577
val bus = new ReplayListenerBus ()
574
578
val listener = new AppListingListener (fileStatus, clock)
0 commit comments