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

[BUG]: WAL replay warnings suppression #1763

Closed

Conversation

tazarov
Copy link
Contributor

@tazarov tazarov commented Feb 23, 2024

Refs: #1733

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Added a EmbeddingRecord flag (wal_replay) to suppress warnings in sqlite and local hnsw indices

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js

Documentation Changes

N/A

Colab to reproduce the issue in 0.4.23 (and prior) - https://colab.research.google.com/drive/1CtN0qGoMZoVfwQBnJE1MloLvvdv5KouE?usp=sharing

Screenshot 2024-03-02 at 21 08 12

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@tazarov tazarov force-pushed the bugfix/wal-replay-ignore-warnings branch from fa94bdb to 71e7619 Compare March 2, 2024 17:55
@atroyn atroyn requested review from HammadB and atroyn March 2, 2024 18:57
Copy link
Contributor

@atroyn atroyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is deeply suspicious to me, and there isn't sufficient detail in the description for me to understand it. Unless I've misunderstood, we should never be emitting duplicate ID warnings - I suspect this might be a real bug in the WAL logic.

Copy link
Contributor Author

tazarov commented Mar 2, 2024

@atroyn, I've added a colab that reproduces the problem.

The gist is that we emit all entries from the WAL up to the index' MAX seqId, if there are duplicate entries (e.g. an item was added/removed multiple times) the respective index reports the duplicates as warnings.

Copy link
Contributor Author

tazarov commented Mar 2, 2024

Similar issue was reported by MemGPT - https://discord.com/channels/1073293645303795742/1205288940488359998

@@ -288,7 +288,9 @@ def _backfill(self, subscription: Subscription) -> None:
.where(t.topic == ParameterValue(subscription.topic_name))
.where(t.seq_id > ParameterValue(subscription.start))
.where(t.seq_id <= ParameterValue(subscription.end))
.select(t.seq_id, t.operation, t.id, t.vector, t.encoding, t.metadata)
.select(
t.seq_id, t.operation, t.id, t.vector, t.encoding, t.metadata, t.topic
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think topic is needed here. Perhaps wrongfully added during testing/experimentation

@tazarov
Copy link
Contributor Author

tazarov commented Apr 26, 2024

This is potentially made redundant by #2062

@tazarov
Copy link
Contributor Author

tazarov commented May 16, 2024

Close in favor of #2062

@tazarov tazarov closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants