YARN-7024: Fix issues on recovery in LevelDB store. Contributed by Jonathan Hung

This commit is contained in:
Xuan 2017-08-23 11:11:41 -07:00 committed by Jonathan Hung
parent 3a31c38885
commit 36cda2ff80
2 changed files with 4 additions and 2 deletions

View File

@ -79,7 +79,7 @@ public synchronized Configuration retrieve() {
@Override
public synchronized List<LogMutation> getPendingMutations() {
return pendingMutations;
return new LinkedList<>(pendingMutations);
}
@Override

View File

@ -65,6 +65,7 @@ public class LeveldbConfigurationStore implements YarnConfigurationStore {
private static final String LOG_COMMITTED_TXN = "committedTxn";
private DB db;
// Txnid for the last transaction logged to the store.
private long txnId = 0;
private long minTxn = 0;
private long maxLogs;
@ -92,6 +93,7 @@ public void initialize(Configuration config, Configuration schedConf)
break;
}
pendingMutations.add(deserLogMutation(entry.getValue()));
txnId++;
}
// Get the earliest txnId stored in logs
itr.seekToFirst();
@ -278,7 +280,7 @@ public synchronized Configuration retrieve() {
@Override
public List<LogMutation> getPendingMutations() {
return pendingMutations;
return new LinkedList<>(pendingMutations);
}
@Override