Created
September 22, 2021 17:09
-
-
Save zsxwing/d520f3cbe838e40582c20b7f19e661e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val version = getCurrentVersionFromConnector | |
val appId = getCurrentAppIdFromConnector | |
val txn = startTxn() | |
val versionInTxn = txn.txnVersion(appId) | |
if (version <= versionInTxn) { | |
// Skip the write that's done | |
return | |
} | |
// write files and commit | |
txn.commit(SetTxn(appId, version) :: ... :: Nil) // system crash | |
// save the version id to somewhere for recovery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment