Skip to content
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

Local: Erroneous State #1022

Closed
ursulacparker opened this issue Jun 7, 2023 · 1 comment
Closed

Local: Erroneous State #1022

ursulacparker opened this issue Jun 7, 2023 · 1 comment

Comments

@ursulacparker
Copy link

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: Windows 10
  • Node Version [e.g. 8.2.1]: 16.15.1
  • NPM Version [e.g. 5.4.2]: 8.11.10
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: Visual studio
  • node-rdkafka version [e.g. 2.3.3]: 2.16.0

Steps to Reproduce
Manually assign a consumer to a topic and partition, then run a producer at the same time.
It will randomly appear (not often). If I restart the consumer it goes away.

node-rdkafka Configuration Settings
'rebalance_cb': function(err : LibrdKafkaError, assignment : Assignment) {
if (err.code === CODES.ERRORS.ERR__ASSIGN_PARTITIONS) {
} else if (err.code == CODES.ERRORS.ERR__REVOKE_PARTITIONS){
} else {
// We had a real error
console.error(err);
}
}

Additional context
C:\Users\user\project\node_modules\node-rdkafka\lib\kafka-consumer.js:263
this._client.assign(TopicPartition.map(assignments));
^

Error: Local: Erroneous state
at KafkaConsumer.assign (C:\Users\user\project\node_modules\node-rdkafka\lib\kafka-consumer.js:263:16)

@constantind
Copy link

This error is to prevent duplicate streaming from the same partition as default offset is at the broker so which one of two would commit? This happens since 1.9.0 see https://github.com/confluentinc/librdkafka/releases/tag/v1.9.0 when you try to call assign more than once to the same topic/partition. if you have more than one partition default rebalance https://github.com/Blizzard/node-rdkafka/blob/master/lib/kafka-consumer.js#L66 should call unassign automatically, however if you have single partition topic that does not trigger and you have to call unassign yourself otherwise second call to find.assignments or assign to the same partition throws that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants