-
Notifications
You must be signed in to change notification settings - Fork 102
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
Fix #1898: Indexing: periodic "Built Range" log message is broken #1899
Conversation
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.
Test?
Result of fdb-record-layer-pr-proto2 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto3 on Linux CentOS 7
|
I've verified that the log message appears in some of the existing tests. Example:
|
@@ -622,7 +624,7 @@ private void validateTimeLimit(int toWait) { | |||
private boolean shouldLogBuildProgress() { | |||
long interval = common.config.getProgressLogIntervalMillis(); | |||
long now = System.currentTimeMillis(); | |||
if (interval == 0 || interval < (now - timeOfLastProgressLogMillis)) { | |||
if (interval == 0 || interval > (now - timeOfLastProgressLogMillis)) { |
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.
I think you could combine a sleep
in the IndexingConfig loader, and TestHelpers.assertLogs
to assert that this is actually logging, and at approximately the right interval.
I don't think the record layer already has anything for mocking out time, but that would probably be beneficial for other tests if you brought something in.
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.
I can do that, but TestHelpers.assertLogs
will not test the interval but just the existence of this message (appearing at first continuation - i.e. in any case of not indexing all in a single transaction).
d2724ed
to
e26a351
Compare
Result of fdb-record-layer-pr-proto3 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto2 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto3 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto2 on Linux CentOS 7
|
Test this please |
e26a351
to
92c3356
Compare
Squashed. |
Result of fdb-record-layer-pr-proto2 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto3 on Linux CentOS 7
|
@@ -622,7 +624,7 @@ private void validateTimeLimit(int toWait) { | |||
private boolean shouldLogBuildProgress() { | |||
long interval = common.config.getProgressLogIntervalMillis(); | |||
long now = System.currentTimeMillis(); | |||
if (interval == 0 || interval < (now - timeOfLastProgressLogMillis)) { | |||
if (interval == 0 || interval > (now - timeOfLastProgressLogMillis)) { |
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.
If I'm reading the Javadoc for getProgressLogIntervalMillis
correctly, I think this is still not quite right:
Get the minimum time between successful progress logs when building across transactions. Negative will not log at all, 0 will log after every commit.
So, if interval == 0
, then I think this method should always return true
, whereas right now, it always returns false
. Likewise, if interval < 0
, then I think this method should always return false
, but I believe it will always return true
as now - timeOfLastProgressLogMillis
will always be non-negative.
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.
✅
openSimpleMetaData(hook); | ||
try (OnlineIndexer indexer = OnlineIndexer.newBuilder() | ||
.setDatabase(fdb).setMetaData(metaData).setIndex(index).setSubspace(subspace) | ||
.setProgressLogIntervalMillis(10) |
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.
I think adding test cases where the progressLogIntervalMillis
is 0 (and logs) and -1 (and doesn't log) may be worth it
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.
✅
Result of fdb-record-layer-pr-proto3 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto2 on Linux CentOS 7
|
…s broken squashed: + Implement John's and Scott's requested change - adding a test
5836116
to
1bccf9c
Compare
Kudos, SonarCloud Quality Gate passed! |
Result of fdb-record-layer-pr-proto3 on Linux CentOS 7
|
Result of fdb-record-layer-pr-proto2 on Linux CentOS 7
|
No description provided.