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

Various bug fixes #53

Merged
merged 5 commits into from
Mar 28, 2019
Merged

Various bug fixes #53

merged 5 commits into from
Mar 28, 2019

Conversation

peterhuffer
Copy link
Contributor

@peterhuffer peterhuffer commented Mar 27, 2019

What does this PR do?

Changes pulled from #52

  • Fixes an issue where a request that was running could have an immediate follow up in the pending requests and the pending request run before the Last Run on history was set, meaning all the metacards would be queried again.
  • Fixes an issue with karaf configuration delete command not cleaning up replication items.
  • Ignore case when creating new replication configs and nodes.

Who is reviewing it (please choose AT LEAST two reviewers that need to approve the PR before it can get merged)?

@clockard @kcover @paouelle

How should this be tested? (List steps with links to updated documentation)

Run log:set DEBUG org.codice.ditto.replication.api.impl

  • Perform a replication and verify the same replicator request is not added to pending requests if it is running (look at logs).
  • Confirm replication:delete -c -h -m deletes replication items in solr as well as the config and all metacards/data.

Any background context you want to provide?

What are the relevant tickets?

Screenshots (if appropriate)

Checklist:

  • Documentation Updated
  • Update / Add Unit Tests
  • Update / Add Integration Tests

@peterhuffer
Copy link
Contributor Author

build now

return false;
}
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

✏️ could just use the get(id) method and if it throws the NotFoundException you know the config doesn't exist. Also, it seems a little misleading to return true when we get a ReplicationPersistenceException.

Copy link
Member

Choose a reason for hiding this comment

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

I would agree that we shouldn't return true on a ReplicationPersistenceException

Copy link
Contributor Author

@peterhuffer peterhuffer Mar 28, 2019

Choose a reason for hiding this comment

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

I changed to return false for now, but I think we will want to throw some sort of error and handle on the front end if we cannot access the persistence store. I can make it do this in the other PR these changes were pulled from.

Copy link
Member

@clockard clockard Mar 28, 2019

Choose a reason for hiding this comment

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

I think that is exactly right. We want to throw an exception up if there is an error instead of returning true/false. I am good with this for now as long as we make that happen in the next pr.

if (!replicationUtils.configExists(id.getValue())) {
addErrorMessage(ReplicationMessages.configDoesNotExist());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

replicationUtils.deleteConfig(id) could be changed to just let the NotFoundException bubble up. Then in the performFunction() method you could just return null with the error message if you catch that exception. At least I think you can do that with the graphql endpoint.

return false;
}
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

I would agree that we shouldn't return true on a ReplicationPersistenceException

@kcover
Copy link
Contributor

kcover commented Mar 27, 2019

Successful hero with the test steps above.

@peterhuffer
Copy link
Contributor Author

build now

@peterhuffer peterhuffer requested a review from clockard March 28, 2019 03:18
@clockard clockard merged commit b206155 into connexta:master Mar 28, 2019
@peterhuffer peterhuffer deleted the bug-fixes branch April 23, 2019 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants