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

Alpha Close: Wait for indexing to complete #5137

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions worker/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ func runSchemaMutation(ctx context.Context, updates []*pb.SchemaUpdate, startTs
defer stopIndexing(closer)

buildIndexesHelper := func(update *pb.SchemaUpdate, rebuild posting.IndexRebuild) error {
// in case background indexing is running, we should call it here again.
defer stopIndexing(closer)

wrtCtx := schema.GetWriteContext(context.Background())
if err := rebuild.BuildIndexes(wrtCtx); err != nil {
return err
Expand All @@ -197,6 +194,9 @@ func runSchemaMutation(ctx context.Context, updates []*pb.SchemaUpdate, startTs
wg.Add(1)
defer wg.Done()
buildIndexes := func(update *pb.SchemaUpdate, rebuild posting.IndexRebuild) {
// In case background indexing is running, we should call it here again.
defer stopIndexing(closer)

// We should only start building indexes once this function has returned.
// This is in order to ensure that we do not call DropPrefix for one predicate
// and write indexes for another predicate simultaneously. because that could
Expand Down