You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Two worker threads find the same index that isn't final yet.
One writes to it, filling it up.
The index saver thread finds the full index and finalizes it.
Then the other worker thread tries to write to it, and panics.
One straightforward fix is to have MasterIndex.Store do Lock instead of RLock.
Another fix is to optimistically try Index.Store, and retry if the index became finalized.
I can code up either if you like, but I'm unsure how to write a test for this.