-
Notifications
You must be signed in to change notification settings - Fork 529
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
graph.graph().tx().commit(); | ||
} catch (Throwable e) { | ||
schemaTx.updateSchemaStatus(indexLabel, SchemaStatus.INVALID); | ||
throw e; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should update status to INVALID when failure to remove vertex/edge label? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "/*"