Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Describe the problems you are trying to solve.

Public Interfaces

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.

A public interface is any change to the following:

  • Binary log format

  • The network protocol and api behavior

  • Any class in the public packages under clientsConfiguration, especially client configuration

    • org/apache/kafka/common/serialization

    • org/apache/kafka/common

    • org/apache/kafka/common/errors

    • org/apache/kafka/clients/producer

    • org/apache/kafka/clients/consumer (eventually, once stable)

  • Monitoring

  • Command line tools and arguments

  • Anything else that will likely break existing users in some way when they upgrade

Proposed Changes

The Stream Table join is not able to handle late data in its current state. This semantic gap leads to incorrect output in some cases as the stream can only process data as it comes in. Also with versioned tables tables can now have history and being able to process the stream in order within the configured grace period will allow even more correct time semantics.

Public Interfaces

Code Block
titleJoined.java
linenumberstrue
Joined {
	/**
	* Set the grace period on the stream side of the join. Late records in the grace period will be processed in timestamp order, records out of the grace period will be dropped.
	*
	* @param gracePeriod the duration of the grace period. If zero no buffer will be used. 
	* @return new {@code Joined} instance configured with the gracePeriod
	*/
	public Joined withGracePeriod(Duration gracePeriod);
}


Proposed Changes

The grace period will be set on the Joined object. This is only used for the stream table join and will be optional to set.

If a grace period is not set the join will execute as before. If a grace period of zero is set the join will drop all late records from the stream side operations. If the grace period is non zero, the record will enter a stream buffer and will dequeue when the record timestamp is greater than stream time plus the grace period.

The buffer will be checked whenever stream time is advanced. Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Test Plan

Describe in few sentences how the KIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?

Rejected Alternatives

...

Old Joins will not be affected, in order to use the new feature users will need to set a grace period. Nothing needs to be deprecated.

Test Plan

The testing should be covered with unit test and integration test. The only other tests that would be necessary, would be benchmarking to assess the  performance impact on the stream buffer on the join.

Rejected Alternatives

  • Only allowing grace period for versioned tables. This would be unnecessarily restrictive especially if the table is not going to change and there is no need for the versioning. Or if the table is already materialized for another use that does not want versioning