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
MOD-5181: Bug fix - Update numeric inverted index numEntries #3606
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3606 +/- ##
==========================================
- Coverage 82.44% 82.38% -0.06%
==========================================
Files 190 190
Lines 31139 31140 +1
==========================================
- Hits 25671 25655 -16
- Misses 5468 5485 +17
☔ View full report in Codecov by Sentry. |
added get tree max depth to pytests
tests/pytests/common.py
Outdated
|
||
|
||
def dump_numeric_index_tree_root(env, idx, numeric_field): | ||
tree_root_stats = dump_numeric_index_tree(env,idx,numeric_field)['root'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231: missing whitespace after ','
❗❗ 3 similar findings have been found in this PR
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
tests/pytests/common.py | 175 |
tests/pytests/test_numbers.py | 11 |
tests/pytests/test_numbers.py | 28 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
tests/pytests/test_numbers.py
Outdated
@@ -7,6 +7,33 @@ | |||
from RLTest import Env | |||
import math | |||
|
|||
def testNumEntries(env): | |||
env.expect('ft.config', 'set', 'FORK_GC_CLEAN_THRESHOLD',0).equal('OK') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W191: indentation contains tabs
❗❗ 19 similar findings have been found in this PR
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
tests/pytests/test_numbers.py | 12 |
tests/pytests/test_numbers.py | 13 |
tests/pytests/test_numbers.py | 15 |
tests/pytests/test_numbers.py | 16 |
tests/pytests/test_numbers.py | 17 |
tests/pytests/test_numbers.py | 18 |
tests/pytests/test_numbers.py | 19 |
tests/pytests/test_numbers.py | 20 |
tests/pytests/test_numbers.py | 21 |
tests/pytests/test_numbers.py | 23 |
Showing 10 of 19 findings. Visit the Lift Web Console to see all.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
env.cmd('hset', f'{i}', 'num', f'{i}') | ||
|
||
# explicitly run gc to update spec stats and the inverted index number of entries. | ||
forceInvokeGC(env, 'idx') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E0602: Undefined variable 'forceInvokeGC'
❗❗ 2 similar findings have been found in this PR
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
tests/pytests/test_numbers.py | 27 |
tests/pytests/test_numbers.py | 31 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
|
||
loops = 15 | ||
hashes_number = 10_000 | ||
expected_depth = 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W191: indentation contains tabs
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
expected_depth = 17 | ||
for i in range(loops): | ||
# In each loop re-index 0, 1,...,`hashes_number`-1 entries with increasing values | ||
for i in range(hashes_number): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W191: indentation contains tabs
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
@@ -165,6 +165,20 @@ def index_info(env, idx): | |||
res = {res[i]: res[i + 1] for i in range(0, len(res), 2)} | |||
return res | |||
|
|||
|
|||
def dump_numeric_index_tree(env, idx, numeric_field): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dump is only at the top level. Consider renaming
tests/pytests/test_numbers.py
Outdated
'maxDepth'] | ||
env.assertGreaterEqual(expected_depth, numeric_tree_depth) | ||
|
||
env.cmd('flushall') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this
* Update numeric inverted index numEntries * added numeric tree test added get tree max depth to pytests (cherry picked from commit 84dbca1)
As the inverted index
numEntries
was never updated, we kept splitting the numeric tree. This caused the memory to grow constantly.In addition, the
numRecords
field in the spec statistics was decreased bynumEntries
upon removing a range, but since thenumEntries
kept growing, and wasn't aligned with the actual number of entries,numRecords
decreased below 0 and overflowed.In this PR we update
numEntries
in the GC according to the number of removed entries collected.related issue -MOD-5181