From 8f4d4aa027f340631a7627f9df85f260d2b033f9 Mon Sep 17 00:00:00 2001 From: Ralf Date: Wed, 31 Jul 2024 14:22:52 +0300 Subject: [PATCH] [FSTORE-1475] fix partial FG deletion (#1542) --- .../search/SearchFSCommandLogger.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hopsworks-common/src/main/java/io/hops/hopsworks/common/commands/featurestore/search/SearchFSCommandLogger.java b/hopsworks-common/src/main/java/io/hops/hopsworks/common/commands/featurestore/search/SearchFSCommandLogger.java index e9218afab6..bd7a28876c 100644 --- a/hopsworks-common/src/main/java/io/hops/hopsworks/common/commands/featurestore/search/SearchFSCommandLogger.java +++ b/hopsworks-common/src/main/java/io/hops/hopsworks/common/commands/featurestore/search/SearchFSCommandLogger.java @@ -154,7 +154,10 @@ private SearchFSCommand getCommand(Featuregroup featureGroup, SearchFSCommandOp command.setInodeId(inode.getId()); command.setProject(featureGroup.getFeaturestore().getProject()); command.setStatus(CommandStatus.NEW); - command.setFeatureGroup(featureGroup); + if (!SearchFSCommandOp.DELETE_ARTIFACT.equals(op)) { + // Don't set it since a separate transaction deletes FG, this could cause it to be potentially recreated + command.setFeatureGroup(featureGroup); + } command.setOp(op); return command; } @@ -171,7 +174,10 @@ private SearchFSCommand getCommand(FeatureView featureView, SearchFSCommandOp op command.setInodeId(inode.getId()); command.setProject(featureView.getFeaturestore().getProject()); command.setStatus(CommandStatus.NEW); - command.setFeatureView(featureView); + if (!SearchFSCommandOp.DELETE_ARTIFACT.equals(op)) { + // Don't set it since a separate transaction deletes FV, this could cause it to be potentially recreated + command.setFeatureView(featureView); + } command.setOp(op); return command; } @@ -194,7 +200,10 @@ private SearchFSCommand getCommand(TrainingDataset trainingDataset, SearchFSComm command.setInodeId(inode.getId()); command.setProject(trainingDataset.getFeaturestore().getProject()); command.setStatus(CommandStatus.NEW); - command.setTrainingDataset(trainingDataset); + if (!SearchFSCommandOp.DELETE_ARTIFACT.equals(op)) { + // Don't set it since a separate transaction deletes TD, this could cause it to be potentially recreated + command.setTrainingDataset(trainingDataset); + } command.setOp(op); return command; }