mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-28 12:37:48 +01:00
less commitSnapshots created
This commit is contained in:
@@ -307,6 +307,15 @@ public class WritebackObjectPersistentStore {
|
||||
return r -> asyncFence(bundleId, r);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last committed transaction ID.
|
||||
*
|
||||
* @return the last committed transaction ID
|
||||
*/
|
||||
public long getLastCommitId() {
|
||||
return _lastCommittedId.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a snapshot of the persistent store, including the pending writes.
|
||||
*
|
||||
|
||||
@@ -165,7 +165,6 @@ public class TransactionService {
|
||||
toUnlock.add(lock);
|
||||
}
|
||||
|
||||
commitSnapshot = writebackObjectPersistentStore.getSnapshot();
|
||||
} else {
|
||||
Log.trace("Committing transaction - no changes");
|
||||
|
||||
@@ -201,7 +200,10 @@ public class TransactionService {
|
||||
Log.trace("Committing transaction start");
|
||||
var snapshotId = tx.snapshot().id();
|
||||
|
||||
if (snapshotId != commitSnapshot.id()) {
|
||||
// All dependencies are locked and could not be changed concurrently now
|
||||
if (snapshotId != writebackObjectPersistentStore.getLastCommitId()) {
|
||||
commitSnapshot = writebackObjectPersistentStore.getSnapshot();
|
||||
|
||||
for (var read : readSet.entrySet()) {
|
||||
var current = commitSnapshot.readObject(read.getKey());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user