You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/06/11 19:10:00 UTC

[GitHub] [incubator-pinot] mcvsubbu opened a new pull request #5542: Changed the stream and metadata interface

mcvsubbu opened a new pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542


   Changed the interface exposed by streams to return StreamPartitionMsgOffset
   instead of long.
   
   Also changed the LLCRealtimeSegmentZKMetadat class to return String instead
   of long offsets, since it is stored as a String anyway. Luckily zk metadata does
   not generate java objects from json automatically (instead, parses the
   fields one by one via custom code).
   
   The segment endOffset can now be null in LLCRealtimeSegmentZKMetadata. For
   backward compatibility, we store Long.toSring(Long.MAX_VALUE) in zookeeper
   so that readers of the metadata do not get NPE if they are still running old
   version. We will remove this workaround after we release 0.5.0
   
   The segment completion protocol for realtime LLC segment completion will
   continue to use both 'offset' and 'streamPartitionOffset' elements for
   one more release, and will move to use the latter completely in 0.6.0
   
   Interfaces PartitionLevelConsumer and StreamMetadataProvider (marked STABLE)
   are now deprecating the calls that use long offsets. Instead, new calls have
   been added that use StreamPartitionMsgOffset. Kafka Plugins have been updated
   to use the new calls, but the old methods are preserved to make sure that any
   other Kafka implementations have time to move over. These calls will be removed
   in 0.6.0
   
   The metric to show the highest offset consumed has disappeared.
   
   Testing done:
   Manually verified that LLCRealtimeClusterIntegrationTest completes segments correctly with
   old server and new controller as well as with new server and old controller, using
   command line starter for controller and server to start a component at a specific
   revision after 0.4.0 release.
   
   Issue #5359 
   
   ## Description
   Add a description of your PR here.
   A good description should include pointers to an issue or design document, etc.
   ## Upgrade Notes
   Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
   * [ ] Yes (Please label as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR fix a zero-downtime upgrade introduced earlier?
   * [ ] Yes (Please label this as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR otherwise need attention when creating release notes? Things to consider:
   - New configuration options
   - Deprecation of configurations
   - Signature changes to public methods/interfaces
   - New plugins added or old plugins removed
   * [ ] Yes (Please label this PR as **<code>release-notes</code>** and complete the section on Release Notes)
   ## Release Notes
   If you have tagged this as either backward-incompat or release-notes,
   you MUST add text here that you would like to see appear in release notes of the
   next release.
   
   If you have a series of commits adding or enabling a feature, then
   add this section only in final commit that marks the feature completed.
   Refer to earlier release notes to see examples of text
   
   ## Documentation
   If you have introduced a new feature or configuration, please add it to the documentation as well.
   See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document
   


----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5542: Changed the stream and metadata interface

Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542#discussion_r439088617



##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManagerTest.java
##########
@@ -77,7 +79,7 @@
 
   private static final long RANDOM_SEED = System.currentTimeMillis();
   private static final Random RANDOM = new Random(RANDOM_SEED);
-  static final long PARTITION_OFFSET = RANDOM.nextInt(Integer.MAX_VALUE);
+  static final LongMsgOffset PARTITION_OFFSET = new LongMsgOffset(RANDOM.nextInt(Integer.MAX_VALUE));

Review comment:
       Discussed offline, we will leave it as is




----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5542: Changed the stream and metadata interface

Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542#discussion_r439069170



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java
##########
@@ -893,20 +891,19 @@ IdealState ensureAllPartitionsConsuming(TableConfig tableConfig, PartitionLevelS
 
             // Create a new segment to re-consume from the previous start offset
             LLCSegmentName newLLCSegmentName = getNextLLCSegmentName(latestLLCSegmentName, currentTimeMs);
-            long startOffset = latestSegmentZKMetadata.getStartOffset();
+            StreamPartitionMsgOffset startOffset = offsetFactory.create(latestSegmentZKMetadata.getStartOffset());

Review comment:
       A bit late for this (you had your chance in PR#5360 :), it is already in the segment completion protocol, and also in config. I can probably change the class name without damaging compat (I think). I would let this be.




----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5542: Changed the stream and metadata interface

Posted by GitBox <gi...@apache.org>.
mcvsubbu commented on a change in pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542#discussion_r439068418



##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManagerTest.java
##########
@@ -77,7 +79,7 @@
 
   private static final long RANDOM_SEED = System.currentTimeMillis();
   private static final Random RANDOM = new Random(RANDOM_SEED);
-  static final long PARTITION_OFFSET = RANDOM.nextInt(Integer.MAX_VALUE);
+  static final LongMsgOffset PARTITION_OFFSET = new LongMsgOffset(RANDOM.nextInt(Integer.MAX_VALUE));

Review comment:
       I think I can change this without affecting compat




----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] kishoreg commented on a change in pull request #5542: Changed the stream and metadata interface

Posted by GitBox <gi...@apache.org>.
kishoreg commented on a change in pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542#discussion_r439062405



##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManagerTest.java
##########
@@ -77,7 +79,7 @@
 
   private static final long RANDOM_SEED = System.currentTimeMillis();
   private static final Random RANDOM = new Random(RANDOM_SEED);
-  static final long PARTITION_OFFSET = RANDOM.nextInt(Integer.MAX_VALUE);
+  static final LongMsgOffset PARTITION_OFFSET = new LongMsgOffset(RANDOM.nextInt(Integer.MAX_VALUE));

Review comment:
        LongOffset

##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/stream/PartitionLevelConsumer.java
##########
@@ -31,19 +31,35 @@
 public interface PartitionLevelConsumer extends Closeable {
 
   /**
+   * Is here for backward compatibility for a short time.
+   * TODO Issue 5359 remove this API once external kafka consumers implements return of StreamPartitionMsgOffset
    * Fetch messages from the stream between the specified offsets
    * @param startOffset
    * @param endOffset
    * @param timeoutMillis
    * @return
    * @throws java.util.concurrent.TimeoutException
    */
+  @Deprecated
   MessageBatch fetchMessages(long startOffset, long endOffset, int timeoutMillis)
       throws java.util.concurrent.TimeoutException;
 
+  /**
+   * Fetch messages and the per-partition high watermark from Kafka between the specified offsets.
+   *
+   * @param startOffset The offset of the first message desired, inclusive
+   * @param endOffset The offset of the last message desired, exclusive, or null
+   * @param timeoutMillis Timeout in milliseconds
+   * @throws java.util.concurrent.TimeoutException If the operation could not be completed within {@code timeoutMillis}
+   * milliseconds
+   * @return An iterable containing messages fetched from the stream partition and their offsets, as well as the
+   * high watermark for this partition.
+   */
   default MessageBatch fetchMessages(StreamPartitionMsgOffset startOffset, StreamPartitionMsgOffset endOffset, int timeoutMillis)

Review comment:
       Nicely done!

##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java
##########
@@ -893,20 +891,19 @@ IdealState ensureAllPartitionsConsuming(TableConfig tableConfig, PartitionLevelS
 
             // Create a new segment to re-consume from the previous start offset
             LLCSegmentName newLLCSegmentName = getNextLLCSegmentName(latestLLCSegmentName, currentTimeMs);
-            long startOffset = latestSegmentZKMetadata.getStartOffset();
+            StreamPartitionMsgOffset startOffset = offsetFactory.create(latestSegmentZKMetadata.getStartOffset());

Review comment:
       We can drop Msg, StreamPartitionOffset




----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mcvsubbu merged pull request #5542: Changed the stream and metadata interface

Posted by GitBox <gi...@apache.org>.
mcvsubbu merged pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542


   


----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter commented on pull request #5542: Changed the stream and metadata interface

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #5542:
URL: https://github.com/apache/incubator-pinot/pull/5542#issuecomment-642905349


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5542?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`master@7b41f5a`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `79.31%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/5542/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz)](https://codecov.io/gh/apache/incubator-pinot/pull/5542?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master    #5542   +/-   ##
   =========================================
     Coverage          ?   66.38%           
   =========================================
     Files             ?     1104           
     Lines             ?    56871           
     Branches          ?     8505           
   =========================================
     Hits              ?    37753           
     Misses            ?    16338           
     Partials          ?     2780           
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | #integrationtests | `44.87% <62.06%> (?)` | |
   | #unittests | `56.82% <72.41%> (?)` | |
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/5542?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...ot/common/protocols/SegmentCompletionProtocol.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vcHJvdG9jb2xzL1NlZ21lbnRDb21wbGV0aW9uUHJvdG9jb2wuamF2YQ==) | `80.58% <ø> (ø)` | |
   | [.../apache/pinot/spi/stream/LongMsgOffsetFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvc3RyZWFtL0xvbmdNc2dPZmZzZXRGYWN0b3J5LmphdmE=) | `100.00% <ø> (ø)` | |
   | [...java/org/apache/pinot/spi/stream/MessageBatch.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvc3RyZWFtL01lc3NhZ2VCYXRjaC5qYXZh) | `0.00% <ø> (ø)` | |
   | [...pache/pinot/spi/stream/PartitionLevelConsumer.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvc3RyZWFtL1BhcnRpdGlvbkxldmVsQ29uc3VtZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...metadata/segment/LLCRealtimeSegmentZKMetadata.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0YWRhdGEvc2VnbWVudC9MTENSZWFsdGltZVNlZ21lbnRaS01ldGFkYXRhLmphdmE=) | `47.61% <75.00%> (ø)` | |
   | [.../core/realtime/PinotLLCRealtimeSegmentManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlYWx0aW1lL1Bpbm90TExDUmVhbHRpbWVTZWdtZW50TWFuYWdlci5qYXZh) | `74.76% <90.00%> (ø)` | |
   | [.../helix/core/realtime/SegmentCompletionManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlYWx0aW1lL1NlZ21lbnRDb21wbGV0aW9uTWFuYWdlci5qYXZh) | `70.84% <100.00%> (ø)` | |
   | [...manager/realtime/LLRealtimeSegmentDataManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvcmVhbHRpbWUvTExSZWFsdGltZVNlZ21lbnREYXRhTWFuYWdlci5qYXZh) | `69.26% <100.00%> (ø)` | |
   | [...pache/pinot/spi/stream/PartitionOffsetFetcher.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvc3RyZWFtL1BhcnRpdGlvbk9mZnNldEZldGNoZXIuamF2YQ==) | `57.14% <100.00%> (ø)` | |
   | [...va/org/apache/pinot/core/query/utils/TrieNode.java](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS91dGlscy9UcmllTm9kZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | ... and [1103 more](https://codecov.io/gh/apache/incubator-pinot/pull/5542/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5542?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/5542?src=pr&el=footer). Last update [7b41f5a...200bb75](https://codecov.io/gh/apache/incubator-pinot/pull/5542?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org