Skip to content
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

GH-5059 remove calls to E(...) when the return value is already being checked #5066

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

hmottestad
Copy link
Contributor

GitHub issue resolved: #5059

Briefly describe the changes proposed in this PR:


PR Author Checklist (see the contributor guidelines for more details):

  • my pull request is self-contained
  • I've added tests for the changes I made
  • I've applied code formatting (you can use mvn process-resources to format from the command line)
  • I've squashed my commits where necessary
  • every commit message starts with the issue number (GH-xxxx) followed by a meaningful description of the change

@hmottestad
Copy link
Contributor Author

@kenwenzel I've removed all the calls to E(...) where the return value was already being checked. Take a look if you can and feel free to merge if you are happy with everything. You can also create a release if you want, if not then I might have time the week of the 8th of July.

@hmottestad hmottestad force-pushed the GH-5059-lmdb-reduce-calls-to-E branch from ad3a1a3 to 935f515 Compare June 28, 2024 20:37
@kenwenzel
Copy link
Contributor

Thank you. However, it helped us to find the empty key issue in the ValueStore. I will try to change that part to prevent looking up empty keys.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep the checks for the put methods to detect any MDB_MAP_FULL errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have access to my computer for a good week. Feel free to modify the PR and merge when you're happy with it. Otherwise I'll look at it when I'm back.

@@ -126,7 +126,7 @@ private synchronized boolean update(Object element, boolean add) throws IOExcept
keyVal.mv_data(keyBuf);

if (add) {
if (E(mdb_put(factory.writeTxn, dbi, keyVal, dataVal, MDB_NOOVERWRITE)) == MDB_SUCCESS) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this to some degree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some simple retry logic to this one.

@@ -873,14 +873,14 @@ public boolean storeTriple(long subj, long pred, long obj, long context, boolean
return recordCache.storeRecord(quad, explicit);
}

int rc = E(mdb_put(writeTxn, mainIndex.getDB(explicit), keyVal, dataVal, MDB_NOOVERWRITE));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this to some degree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually checked right below.

@hmottestad hmottestad merged commit 5ed5bad into main Jul 9, 2024
8 of 9 checks passed
@hmottestad hmottestad deleted the GH-5059-lmdb-reduce-calls-to-E branch July 9, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants