Skip to content

当OFFSET_OUT_OF_RANGE时,调用ListOffsetRequest时 currentLeaderEpoch没有设定,导致响应的数据是错的 #44

@djwjiawei

Description

@djwjiawei
  • 你遇到了什么问题?

当OFFSET_OUT_OF_RANGE时,调用ListOffsetRequest时 currentLeaderEpoch没有设定,导致响应的数据是错的

  • Kafka 环境是自建还是云服务?

自建

  • 请执行下面的命令获取环境信息。

php -v & php --ri swoole & composer info | grep longlang/phpkafka

# 粘贴到这里
[1] 26314
[2] 26315

swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.4.15
Built => May 31 2021 05:59:33
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.0.2k-fips  26 Jan 2017
http2 => enabled
pcre => enabled
zlib => 1.2.7
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
PHP 7.4.19 (cli) (built: May 31 2021 04:55:16) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Yasd v0.3.8, Our Copyright, by codinghuang
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? 
longlang/phpkafka                  v1.1.4  A kafka client. Support php-fpm and Swoole.

  • 提供最小可复现代码:
// 你的代码
ListOffsetPartition类的$currentLeaderEpoch属性默认是0 ,请求是没有指定,返回的offset是错误的
![image](https://user-images.githubusercontent.com/19905508/127950842-92699354-e950-4884-b185-1d8c9464de3d.png)

//在OffsetManager的updateListOffsets方法里指定后 返回是正常的:
 $listOffsetPartition->setPartitionIndex($partition)->setTimestamp(-1)->setCurrentLeaderEpoch($leaderEpoch[$partition]);
![image](https://user-images.githubusercontent.com/19905508/127950974-1a408f6e-49fa-4426-a58e-a2ab5ca3136f.png)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions