This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Consistently compare to the earliest known stream position in the stream change cache #14435
Merged
Merged
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
64dc954
Add (failing) tests.
clokep c969ab4
Use strict comparisons in stream change cache.
clokep 3a46941
Newsfragment
clokep f0dbf31
Update asserts.
clokep 7d0e07f
Clarify comments.
clokep 9842054
Use peek instead of bisect.
clokep 0c6c603
Clarify code & comments.
clokep e2e4f37
Improve docstrings.
clokep 532f69a
Update tests for changes.
clokep dff4b5c
Merge branch 'develop' into clokep/stream-cache-fix
clokep 6b09889
Bump min sortedcontainers version.
clokep f0634bf
Merge remote-tracking branch 'origin/develop' into clokep/stream-cach…
clokep d3513a3
Fix poetry lock.
clokep ae77f8b
Newsfragment
clokep 53cd4cc
Add a comment.
clokep 865792a
Merge remote-tracking branch 'origin/develop' into clokep/stream-cach…
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,7 @@ def has_entity_changed(self, entity: EntityType, stream_pos: int) -> bool: | |
| """Returns True if the entity may have been updated since stream_pos""" | ||
| assert isinstance(stream_pos, int) | ||
|
|
||
| if stream_pos < self._earliest_known_stream_pos: | ||
| if stream_pos <= self._earliest_known_stream_pos: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| self.metrics.inc_misses() | ||
| return True | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,8 @@ def test_has_entity_changed(self): | |
| # return True, whether it's a known entity or not. | ||
| self.assertTrue(cache.has_entity_changed("[email protected]", 0)) | ||
| self.assertTrue(cache.has_entity_changed("[email protected]", 0)) | ||
| self.assertTrue(cache.has_entity_changed("[email protected]", 3)) | ||
| self.assertTrue(cache.has_entity_changed("[email protected]", 3)) | ||
|
|
||
| def test_entity_has_changed_pops_off_start(self): | ||
| """ | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.