From 29d2bfe8a122821c6df2a5755601326536af31b1 Mon Sep 17 00:00:00 2001 From: Ralf Date: Wed, 31 Jul 2024 14:24:43 +0300 Subject: [PATCH] [FSTORE-1475] fix partial FG deletion (#1540) --- .../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 43c4e5f7a4..efb606224c 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; }