-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve] [txn] [PIP-160] Txn buffered writer for transaction log batch #16428
Conversation
@liangyepianzhou @congbobo184 Could you take a look |
/pulsarbot run-failure-checks |
...inator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
...inator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
...inator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
...nator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
...nator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
prefix.writeChar(BATCHED_ENTRY_DATA_PREFIX_VERSION); | ||
ByteBuf actualContent = this.dataSerializer.serialize(this.dataArray); | ||
ByteBuf pairByteBuf = Unpooled.wrappedUnmodifiableBuffer(prefix, actualContent); | ||
FlushContext<T> flushContext = FlushContext.newInstance(this.dataArray, this.asyncAddArgsList); |
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.
why FlushContext should use dataArray
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.
In addComplete(Position position, ByteBuf byteBuf, Object ctx)
we return null param-byteBuf. Maybe callback implementation needs the data(T) in the future.
Does not need it right now, so delete it.
...nator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
...nator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriter.java
Outdated
Show resolved
Hide resolved
...r/src/test/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriterTest.java
Outdated
Show resolved
Hide resolved
...r/src/test/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriterTest.java
Outdated
Show resolved
Hide resolved
byteBufBatchedEntryDataList.add(content); | ||
return content; | ||
} | ||
}, 512, 1024 * 1024 * 4, 1, true); |
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.
every condition needs to be tested. In this case are time, data number, data size
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.
Good suggestion
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.
Yes, it's good to have a data provider.
…ation for transaction log and pending ack store
/pulsarbot run-failure-checks |
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.
Looks general good me, left some minor comments.
...nator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriter.java
Show resolved
Hide resolved
log.error("Cancel task that schedule at fixed rate trig flush failure. The state will stay at CLOSING." | ||
+ " managedLedger: " + managedLedger.getName()); | ||
}); |
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 the scheduledFuture already cancelled, we don't need this log.
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.
Already fixed.
...r/src/test/java/org/apache/pulsar/transaction/coordinator/impl/TxnLogBufferedWriterTest.java
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
Master Issue: #15370
Motivation
see #15370
Modifications
I will complete proposal #15370 with these pull requests( current pull request is the step-1 ):
TxnLogBufferedWriter
Documentation
doc-required
doc-not-needed
doc
doc-complete