Skip to content

Commit 29d2bfe

Browse files
authored
[FSTORE-1475] fix partial FG deletion (#1540)
1 parent 4a112ff commit 29d2bfe

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

hopsworks-common/src/main/java/io/hops/hopsworks/common/commands/featurestore/search/SearchFSCommandLogger.java

+12-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ private SearchFSCommand getCommand(Featuregroup featureGroup, SearchFSCommandOp
154154
command.setInodeId(inode.getId());
155155
command.setProject(featureGroup.getFeaturestore().getProject());
156156
command.setStatus(CommandStatus.NEW);
157-
command.setFeatureGroup(featureGroup);
157+
if (!SearchFSCommandOp.DELETE_ARTIFACT.equals(op)) {
158+
// Don't set it since a separate transaction deletes FG, this could cause it to be potentially recreated
159+
command.setFeatureGroup(featureGroup);
160+
}
158161
command.setOp(op);
159162
return command;
160163
}
@@ -171,7 +174,10 @@ private SearchFSCommand getCommand(FeatureView featureView, SearchFSCommandOp op
171174
command.setInodeId(inode.getId());
172175
command.setProject(featureView.getFeaturestore().getProject());
173176
command.setStatus(CommandStatus.NEW);
174-
command.setFeatureView(featureView);
177+
if (!SearchFSCommandOp.DELETE_ARTIFACT.equals(op)) {
178+
// Don't set it since a separate transaction deletes FV, this could cause it to be potentially recreated
179+
command.setFeatureView(featureView);
180+
}
175181
command.setOp(op);
176182
return command;
177183
}
@@ -194,7 +200,10 @@ private SearchFSCommand getCommand(TrainingDataset trainingDataset, SearchFSComm
194200
command.setInodeId(inode.getId());
195201
command.setProject(trainingDataset.getFeaturestore().getProject());
196202
command.setStatus(CommandStatus.NEW);
197-
command.setTrainingDataset(trainingDataset);
203+
if (!SearchFSCommandOp.DELETE_ARTIFACT.equals(op)) {
204+
// Don't set it since a separate transaction deletes TD, this could cause it to be potentially recreated
205+
command.setTrainingDataset(trainingDataset);
206+
}
198207
command.setOp(op);
199208
return command;
200209
}

0 commit comments

Comments
 (0)