THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Enhance log compaction to support more than just offset comparison, so the insertion order isn't always dictating which records to keep (in effect, allowing for a form of OCC);
- The current behavior should remain as the default in order to minimize impact on already existing clients and avoid any migration efforts;
- Add new Kafka configuration "log.cleaner.compaction.strategy" to toggle the compaction strategy to this approach;
- Add new Topic configuration "compaction.strategy" representing the same as above, with reserved values "offset" and "timestamp";
- The default value of these configurations should be "offset", which represents the previous behavior;
- When this configuration is set to "timestamp", then the record timestamp will be used to determine which record to keep, in a 'keep-highest' approach;
- When this configuration is set to anything other than "offset" or "timestamp", then the record headers are scanned for a key matching this value. If this header is found then this value will be used to determine which record to keep, in a 'keep-highest' approach;
- As the header value exists as a byte array, it is up to the client to ensure that the represented bytes can be be compared in a lexicographic order.When this configuration is set to anything other than "offset" or "timestamp", then the record headers are scanned for a key matching this value. If this header is found, and its value is a "long", then this value will be used to determine which record to keep, in a 'keep-highest' approach;
When both records being compared contain a matching "compaction value" and their corresponding byte arrays are that is considered equal, then the record with the highest offset will be kept;
When both records being compared do not have a "compaction value" at all, then the record with the highest offset will be kept;
When only one of the records being compared has a "compaction value", then this record is kept (as the other is considered to be anomalous);
...