I encountered the error of errIndexingInProgress. Please retry when alter the schema

Continuing the discussion from Better pydgraph errors:

I have been waiting over 90 minutes… how long do I need to wait?

I believe I created a bad index that I now want to change, but I have to wait until that bad index is fully built before I can change it?

There is no way to currently cancel an ongoing indexing operation but it should be possible to do so. I am going to accept this as a feature request.

You can monitor the status of an indexing operation from Alpha logs. There are rebuilding index for predicate xxx print statements. The health endpoint also shows if there is an indexing operation going on. https://dgraph.io/docs/deploy/dgraph-alpha/#querying-health

1 Like

The ticket for this topic has been created. See here

Well, I don’t have access to see the ticket, but guess I don’t have to be able to see it…

@pawan, is there anyway to bypass this block manually for the time being? I have been locked from changing my schema for over 8 hours today. Looking at the health endpoint trying to see the progress of the index and it has been indexing the same predicate ever since I first brought up the health endpoint about 4 hours ago. (Yes, I have refreshed it, lol). The strangest part, is that the predicate that is taking foever and a year to index does not contain any data. hmm. Why would zero data take so long to index?

That is strange and should not be happening. If there is no data, then it should be a no-op. Can you share what change in the schema caused this?

Is this for your instance on Slash? There are some logs printed in Dgraph which share details about the schema update as well.

Yes, it was on Slash. It is now resolved. I opened a support ticket, and received the response that they would look at the logs, so maybe they found the culprit?

I updated schema again and it went through and finished indexing in a timely manner.

I do think it was due to a bad schema design that I made which started the long wait, and then undid which initiated an even longer wait.

I tried to make a three way relationship (Learned to just don’t do that.)

type Contact {
  ...
  relationships: [Relationship] @hasInverse(field: to, field: of)
}
type Relationship {
  ...
  to: Contact
  of: Contact
}

But then changed it to:

type Contact {
  ...
  relationshipsTo: [Relationship] @hasInverse(field: of)
  relationshipsOf: [Relationship] @hasInverse(field: to)
}
type Relationship {
  ...
  to: Contact
  of: Contact
}

This was done when there were Contacts, but there were no Relationships, so there were no Contact.relationships.

What the indexing seem to be stuck on though was an unrelated field that did not change. I will say that the field has a ton of data in it, but still it did not change.

So followup question: What gets re-indexed when a schema changes? Just the new indexes or changed indexes? Or does all of the index get rebuilt as a whole? If the latter is the case, then I probably need to look deeper into the index that was taking so much time. But now I am not sure since it updated in less than a minute after a change today.

1 Like

Only the changed indexes get rebuilt upon a schema change. Our hypothesis is that maybe the schema change was cancelled (timed out) but Dgraph still thought that it was going on. Hence, it didn’t allow another update. I have asked @ibrahim to check this out.

The indexing check here fails if the operation didn’t complete sucessfully and if the closer.Done() is not called, the alpha will think is it still reindexing while the reindexing has finished.

This has been fixed by fix ErrIndexingInProgress if schema update fails by NamanJain8 · Pull Request #6583 · dgraph-io/dgraph · GitHub. Closing this issue.

1 Like