Hi everyone! I see an issue using Record Layer and do not know how could I fix it properly.
I scan in a given recordStore by secondary index (let’s call it expiration_timestamp) and getting primary keys that using later in deleteRecordAsync. deleteRecordAsync returns false for some pKeys. I check and looks like there is a number of indexes that referring to nonexistent records.
First of all, I’m not sure how could it happen, as I understand that deleteRecord should delete both the record itself and related index(indexes), but some records have been deleted and related indexes are still there.
So the question is how to delete invalid indexes using record layer? And how to prevent such cases in a first place? I do appreciate if someone could help with this case.
Hi Sergey, I apologize for the long delay in replying to your question. To clarify to wording:
as I understand that deleteRecord should delete both the record itself and related index(indexes), but some records have been deleted and related indexes are still there.
I assume you mean “related index entries are still there”? Deleting a record should never delete and index, only the index entries associated with that index.
Do you have an example program that can reproduce this? Certainly, deleting a record should clean up all associated entries, so we would be very interested in a case that can reproduce this problem.