-
Notifications
You must be signed in to change notification settings - Fork 938
Use orphaned docs as part of GC calculation #1355
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
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.
LGTM with some optional renames.
): PersistencePromise<number> { | ||
const docCountPromise = this.orphanedDocmentCount(txn); | ||
const targetCountPromise = this.db.getQueryCache().getQueryCount(txn); | ||
return targetCountPromise.next(targetCount => |
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.
We usually don't include Promise
in the name. You can respond to this by just inlining the calls though :)
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'm going to leave as-is. Inlining would put the operations in sequence, rather than in parallel. Also, the code is dealing with both the promise of the count, and the count itself, so I think it's worthwhile to distinguish them.
const targetCountPromise = this.persistence | ||
.getQueryCache() | ||
.getTargetCount(txn); | ||
return targetCountPromise.next(targetCount => |
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.
Same comment regarding the naming as above.
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.
As above.
* Use orphaned documents in sequence number count
* Use orphaned documents in sequence number count
Port of firebase/firebase-android-sdk#80
We had originally decided to only look at targets when assessing how much to run GC. However, based on running a write-heavy workload test, we need to include documents that ended up cached without being part of a target.