-
Notifications
You must be signed in to change notification settings - Fork 970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix meta #3844
Closed
Closed
Fix meta #3844
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,7 @@ | |
// access this entry in this LedgerTxn." See below for the | ||
// concurrency-control issues this is designed to trap. | ||
// | ||
// - Entries are made-active by calling load(), create(), or restore(), each | ||
// - Entries are made-active by calling load(), or create(), each | ||
// of which returns a LedgerTxnEntry which is a handle that can be used to | ||
// get at the underlying LedgerEntry. References to the underlying | ||
// LedgerEntries should generally not be retained anywhere, because the | ||
|
@@ -541,7 +541,7 @@ class AbstractLedgerTxn : public AbstractLedgerTxnParent | |
virtual void commit() noexcept = 0; | ||
virtual void rollback() noexcept = 0; | ||
|
||
// loadHeader, create, restore, erase, load, and loadWithoutRecord provide | ||
// loadHeader, create, erase, load, and loadWithoutRecord provide | ||
// the main interface to interact with data stored in the AbstractLedgerTxn. | ||
// These functions only allow one instance of a particular data to be active | ||
// at a time. | ||
|
@@ -552,11 +552,6 @@ class AbstractLedgerTxn : public AbstractLedgerTxnParent | |
// Creates a new LedgerTxnEntry from entry. Throws if the key | ||
// associated with this entry is already associated with an entry in | ||
// this AbstractLedgerTxn or any parent. | ||
// - restore | ||
// Creates a new LedgerTxnEntry from expired entry. Throws if the key | ||
// associated with this entry is already associated with an entry in | ||
// this AbstractLedgerTxn or any parent or if the expired entry being | ||
// restored does not exist | ||
// - erase | ||
// Erases the existing entry associated with key. Throws if the key is | ||
// not already associated with an entry in this AbstractLedgerTxn or | ||
|
@@ -578,12 +573,9 @@ class AbstractLedgerTxn : public AbstractLedgerTxnParent | |
virtual LedgerTxnHeader loadHeader() = 0; | ||
virtual LedgerTxnEntry create(InternalLedgerEntry const& entry) = 0; | ||
|
||
#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION | ||
virtual LedgerTxnEntry restore(InternalLedgerEntry const& entry) = 0; | ||
#endif | ||
|
||
virtual void erase(InternalLedgerKey const& key) = 0; | ||
virtual LedgerTxnEntry load(InternalLedgerKey const& key) = 0; | ||
virtual LedgerTxnEntry load(InternalLedgerKey const& key, | ||
bool loadExpiredEntry = false) = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this an optional parameter in the interest of time. We're going to remove this anyways so it should be fine. |
||
virtual ConstLedgerTxnEntry loadWithoutRecord(InternalLedgerKey const& key, | ||
bool loadExpiredEntry) = 0; | ||
|
||
|
@@ -716,10 +708,6 @@ class LedgerTxn : public AbstractLedgerTxn | |
|
||
LedgerTxnEntry create(InternalLedgerEntry const& entry) override; | ||
|
||
#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION | ||
LedgerTxnEntry restore(InternalLedgerEntry const& entry) override; | ||
#endif | ||
|
||
void erase(InternalLedgerKey const& key) override; | ||
|
||
UnorderedMap<LedgerKey, LedgerEntry> getAllOffers() override; | ||
|
@@ -760,7 +748,8 @@ class LedgerTxn : public AbstractLedgerTxn | |
getNewestVersion(InternalLedgerKey const& key, | ||
bool loadExpiredEntry) const override; | ||
|
||
LedgerTxnEntry load(InternalLedgerKey const& key) override; | ||
LedgerTxnEntry load(InternalLedgerKey const& key, | ||
bool loadExpiredEntry = false) override; | ||
|
||
void createWithoutLoading(InternalLedgerEntry const& entry) override; | ||
void updateWithoutLoading(InternalLedgerEntry const& entry) override; | ||
|
This file contains 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
This file contains 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
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add an expiration check above in
LedgerTxn::Impl::getNewestVersion
now thatmEntry
may contain expired entries sinceload
may make an expired entry active. This also applies ingetNewestVersionEntryMap
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Fixed