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

OAK-11541: Reduce number of traversed documents on first iterations of FullGC #2130

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,16 @@ private void logQueryExplain(String logMsg, @NotNull Bson query, Bson hint) {
public Iterable<NodeDocument> getModifiedDocs(final long fromModified, final long toModified, final int limit,
@NotNull final String fromId, @NotNull Set<String> includedPathPrefixes,
@NotNull Set<String> excludedPathPrefixes) {
long toModifiedRestricted = toModified;
// Query a maximum of 24h of data to speed up the query on Mongo side
if (toModified - fromModified > TimeUnit.DAYS.toMillis(1)) {
LOG.debug("getModifiedDocs() <- fromModified: {}, toModified: {} - too large range, limiting to 24h",
fromModified, toModified);
toModifiedRestricted = fromModified + TimeUnit.DAYS.toMillis(1);
}

LOG.info("getModifiedDocs fromModified: {}, toModified: {}, limit: {}, fromId: {}, includedPathPrefixes: {}, excludedPathPrefixes: {}",
fromModified, toModified, limit, fromId, includedPathPrefixes, excludedPathPrefixes);
fromModified, toModifiedRestricted, limit, fromId, includedPathPrefixes, excludedPathPrefixes);

final long fromModifiedQuery;
if (MIN_ID_VALUE.equals(fromId)) {
Expand All @@ -268,7 +276,7 @@ public Iterable<NodeDocument> getModifiedDocs(final long fromModified, final lon
withIncludeExcludes(includedPathPrefixes, excludedPathPrefixes,
and(eq(MODIFIED_IN_SECS, fromModifiedQuery), gt(ID, fromId))),
withIncludeExcludes(includedPathPrefixes, excludedPathPrefixes,
and(gt(MODIFIED_IN_SECS, fromModifiedQuery), lt(MODIFIED_IN_SECS, getModifiedInSecs(toModified)))));
and(gt(MODIFIED_IN_SECS, fromModifiedQuery), lt(MODIFIED_IN_SECS, getModifiedInSecs(toModifiedRestricted)))));

// first sort by _modified and then by _id
final Bson sort = ascending(MODIFIED_IN_SECS, ID);
Expand Down
Loading