You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/09/08 13:30:41 UTC
[GitHub] [lucene-solr] mikemccand commented on a change in pull request #1839: LUCENE-9511: Include StoredFieldsWriter in DWPT accounting
mikemccand commented on a change in pull request #1839:
URL: https://github.com/apache/lucene-solr/pull/1839#discussion_r484909064
##########
File path: lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
##########
@@ -351,7 +354,7 @@ FlushedSegment flush(DocumentsWriter.FlushNotifications flushNotifications) thro
flushState.liveDocs.clear(deleteDocIDs[i]);
}
flushState.delCountOnFlush = numDeletedDocIds;
- bytesUsed.addAndGet(-(deleteDocIDs.length * Integer.SIZE));
+ bytesUsed.addAndGet(-(deleteDocIDs.length * Integer.BYTES));
Review comment:
Whoa, this was a latent (over-counting) bug? Maybe `grep` for other places we are possibly incorrectly using `Integer.SIZE`!
Though, I think this array is typically tiny (usually 0 length), since it holds docs that hit non-aborting exception during indexing?
##########
File path: lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
##########
@@ -292,7 +295,7 @@ private void deleteLastDocs(int docCount) {
for (int docId = from; docId < to; docId++) {
deleteDocIDs[numDeletedDocIds++] = docId;
}
- bytesUsed.addAndGet((deleteDocIDs.length - size) * Integer.SIZE);
+ bytesUsed.addAndGet((deleteDocIDs.length - size) * Integer.BYTES);
Review comment:
Also a latent over-counting bug?
##########
File path: lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
##########
@@ -52,7 +52,7 @@
/** Default general purpose indexing chain, which handles
* indexing all types of fields. */
final class DefaultIndexingChain extends DocConsumer {
- final Counter bytesUsed;
+ final Counter bytesUsed = Counter.newCounter();
Review comment:
So we are breaking out a separate `Counter` for `DefaultIndexingChain`, from `DWPT`, when previously they shared the same counter?
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org