diqiu50 commented on code in PR #10740:
URL: https://github.com/apache/gravitino/pull/10740#discussion_r3199850915
##########
core/src/main/java/org/apache/gravitino/storage/relational/RelationalEntityStore.java:
##########
@@ -183,8 +184,9 @@ public <E extends Entity & HasIdentifier> List<E> batchGet(
public boolean delete(NameIdentifier ident, Entity.EntityType entityType,
boolean cascade)
throws IOException {
try {
+ boolean deleted = backend.delete(ident, entityType, cascade);
cache.invalidate(ident, entityType);
- return backend.delete(ident, entityType, cascade);
+ return deleted;
} catch (NoSuchEntityException e) {
Review Comment:
Always invalidate cache in finally block
##########
core/src/main/java/org/apache/gravitino/storage/relational/RelationalEntityStore.java:
##########
@@ -183,8 +184,9 @@ public <E extends Entity & HasIdentifier> List<E> batchGet(
public boolean delete(NameIdentifier ident, Entity.EntityType entityType,
boolean cascade)
throws IOException {
try {
+ boolean deleted = backend.delete(ident, entityType, cascade);
cache.invalidate(ident, entityType);
- return backend.delete(ident, entityType, cascade);
+ return deleted;
} catch (NoSuchEntityException e) {
Review Comment:
Always invalidate the cache in finally block
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]