-
Notifications
You must be signed in to change notification settings - Fork 358
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
FileGraphLibrary no longer works with FederatedStore #3129
Comments
I've had a look at this and can reproduce it with a simple test within Gaffer which attempts to create a second store instead of restarting. Debugging reveals this is indeed caused by the getSchema changes. When creating a new
This could be fixed in various ways.
Overall, I'd recommend refactoring |
Could this be changed to getSchema() == null ?
|
No, it is used to set the schema if none was supplied and that call uses |
The fix for this issue was to only get the Schema from the Store if it is The crash happened because when the store was restarted the schema from the A workaround was to delete the schema file created by As Federated Stores do not have schemas in the usual sense, it doesn't make sense to be checking or fetching them at all. To better accommodate this in future, I would suggest changing |
* Only use Store's schema if supplied schema is null The supplied schema will be empty for schemaless stores * Remove unnecessary Mockito stubbings Various stubbings now unnecessary. These were a consequence of taking schema from the Store when empty. * Remove Empty Schema specific test Test no longer required as schema will no longer be fetched from store in this situation * Remove redundant graphId check, add test for this and improve doc This graph id null check is never used because this is already checked when initialising the store * Remove redundant code for setting NoGraphLibrary This exact code is run inside GraphConfig and is not required in Graph.java * Fix FederatedStore getSchema method Javadoc This incorrectly stated that an empty scheam would always be returned, this will usually be the case but not if a default context/user is valid for a graph * Add IT to test restarting a Federated Store using a FileGraphLibrary
Describe the bug
You can no longer use a FileGraphLibrary with a FederatedStore. If you add a graph and restart the store, it will crash.
This may be due to changes with how getSchema works. When the FederatedStore is started, a file in the library is made with its empty schema. When a graph is added, the getSchema changes now mean that it will return the merged schema. When the FederatedStore is restarted, this schema now conflicts with the empty schema file, causing a crash.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
This behaviour should be possible and worked in Gaffer 1.
Additional context
I think this problem not being caught indicates we need better tests for turning the FederatedStore on and off, and how this interacts with persistent caches and the FileGraphLibrary.
Also, why isn't there a way to use the cache for the graph library? A file does not seem like the best way top store the graph library.
The text was updated successfully, but these errors were encountered: