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

set indexlabel invalid if create or rebuild failed #1226

Merged
merged 6 commits into from
Oct 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ protected static void removeIndexLabel(HugeGraphParams graph, Id id) {
// TODO add update lock
// Set index label to "deleting" status
schemaTx.updateSchemaStatus(indexLabel, SchemaStatus.DELETING);
// Remove index data
// TODO: use event to replace direct call
graphTx.removeIndex(indexLabel);
// Remove label from indexLabels of vertex or edge label
removeIndexLabelFromBaseLabel(schemaTx, indexLabel);
removeSchema(schemaTx, indexLabel);
// Should commit changes to backend store before release delete lock
graph.graph().tx().commit();
try {
// Remove index data
// TODO: use event to replace direct call
graphTx.removeIndex(indexLabel);
// Remove label from indexLabels of vertex or edge label
removeIndexLabelFromBaseLabel(schemaTx, indexLabel);
removeSchema(schemaTx, indexLabel);
// Should commit changes to backend store
// before release delete lock
Copy link
Contributor

Choose a reason for hiding this comment

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

use "/*"

graph.graph().tx().commit();
} catch (Throwable e) {
schemaTx.updateSchemaStatus(indexLabel, SchemaStatus.INVALID);
throw e;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should update status to INVALID when failure to remove vertex/edge label?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need. Fail to remove vertex/edge label will lead to partial delete of vertices/edges. vertex/edge label need to be still valid for remaining vertices/edges

} finally {
locks.unlock();
}
Expand Down