maytasm commented on a change in pull request #9965:
URL: https://github.com/apache/druid/pull/9965#discussion_r437818716
##########
File path:
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataManager.java
##########
@@ -403,11 +425,16 @@ private void awaitOrPerformDatabasePoll()
}
/**
- * If the latest {@link DatabasePoll} is a {@link PeriodicDatabasePoll}, or
an {@link OnDemandDatabasePoll} that is
- * made not longer than {@link #periodicPollDelay} from now, awaits for it
and returns true; returns false otherwise,
- * meaning that a new on-demand database poll should be initiated.
+ * This method returns true without waiting for database poll if the latest
{@link DatabasePoll} is a
+ * {@link PeriodicDatabasePoll} that has completed it's first poll, or an
{@link OnDemandDatabasePoll} that is
+ * made not longer than {@link #periodicPollDelay} from current time.
+ * This method does wait untill completion for if the latest {@link
DatabasePoll} is a
+ * {@link PeriodicDatabasePoll} that has not completed it's first poll, or
an {@link OnDemandDatabasePoll} that is
+ * alrady in the process of polling the database.
+ * This means that any method using this check can read from snapshot that is
+ * up to {@link SqlSegmentsMetadataManager#periodicPollDelay} old.
*/
- private boolean awaitLatestDatabasePoll()
+ private boolean useLatestSnapshotIfWithinDelay()
Review comment:
Just saying awaitLatestDatabasePoll is misleading as it does not always
guarantee wait on latest database poll.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]