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-2457 double caching issue #2595

Merged
merged 149 commits into from
Nov 2, 2022
Merged

Conversation

GCHQDev404
Copy link
Contributor

@GCHQDev404 GCHQDev404 commented Mar 2, 2022

GCHQDev404 and others added 30 commits February 5, 2021 07:26
…federatedstore-federated-operation-remove-midput

# Conflicts:
#	store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/FederatedOperation.java
@GCHQDev404 GCHQDev404 added the federated-store Specific to/touches the federated-store module label Oct 27, 2022
@GCHQDev404 GCHQDev404 added this to the v2.0.0-alpha-0.4 milestone Oct 27, 2022
Copy link
Member

@GCHQDeveloper314 GCHQDeveloper314 left a comment

Choose a reason for hiding this comment

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

I can see quite a few comments of TODO FS. Could it be clarified if this PR is ready for merge? Some of the comment do look like they can be addressed later.
Instead of leaving these comments in the code, a follow up issue could be raised - especially for the comments in the tests.

} catch (final Exception e) {
throw new StorageException("Error adding graph " + graphId + " to storage due to: " + e.getMessage(), e);
throw new StorageException("Error adding graph " + graphId + (nonNull(e.getMessage()) ? (" to storage due to: " + e.getMessage()) : "."), e);
Copy link
Member

Choose a reason for hiding this comment

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

Using String.Format would be better than concatenation.

@GCHQDev404
Copy link
Contributor Author

I can see quite a few comments of TODO FS. Could it be clarified if this PR is ready for merge? Some of the comment do look like they can be addressed later.
Instead of leaving these comments in the code, a follow up issue could be raised - especially for the comments in the tests.

These are left in for when I'm showing team the code.
It's so people know what I'm thinking and where I'm thinking it, before a ticket is made.
Most of these TODOs will be addressed during Alpha stages.
The comments do not affect reviewing of code.

Copy link
Member

@GCHQDeveloper314 GCHQDeveloper314 left a comment

Choose a reason for hiding this comment

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

No comments requiring changes, therefore approved.

public static final boolean DEFAULT_DISABLED_BY_DEFAULT = false;
public static final String ERROR_ADDING_GRAPH_TO_CACHE = "Error adding graph, GraphId is known within the cache, but %s is different. GraphId: %s";
public static final String USER_IS_ATTEMPTING_TO_OVERWRITE = "User is attempting to overwrite a graph within FederatedStore. GraphId: %s";
public static final String ACCESS_IS_NULL = "Can not put graph into storage without a FederatedAccess key.";
public static final String GRAPH_IDS_NOT_VISIBLE = "The following graphIds are not visible or do not exist: %s";
private final Map<FederatedAccess, Set<Graph>> storage = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Have there been any tests to see how much removing the local cache impacts performance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

none.
but the code was written so that the graph creation from GraphSerialisable happens in the last moment to where an operation actually requires execution.
Its possible that a transient Graph object could be placed in the GraphSerialisable but a code review would be required to work out how many times a GraphSerialisable object gets re-used.

t92549
t92549 previously approved these changes Oct 31, 2022
@GCHQDeveloper314 GCHQDeveloper314 removed this from the v2.0.0-alpha-0.4 milestone Oct 31, 2022
@lb324567 lb324567 self-requested a review November 2, 2022 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
federated-store Specific to/touches the federated-store module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FederatedGraphStore double-caching causes desync issues in replicated deployment
5 participants