YARN-7024: Fix issues on recovery in LevelDB store. Contributed by Jonathan Hung
This commit is contained in:
parent
3a31c38885
commit
36cda2ff80
@ -79,7 +79,7 @@ public synchronized Configuration retrieve() {
|
||||
|
||||
@Override
|
||||
public synchronized List<LogMutation> getPendingMutations() {
|
||||
return pendingMutations;
|
||||
return new LinkedList<>(pendingMutations);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user