@platformatic/rdkafka 4.0.0 → 4.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bench/seed.sh +0 -0
- package/binding.gyp +3 -3
- package/ci/prepublish.js +4 -3
- package/ci/update-version.js +123 -0
- package/config.d.ts +126 -10
- package/configure +0 -0
- package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
- package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
- package/deps/librdkafka/.semaphore/semaphore.yml +67 -44
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +471 -1
- package/deps/librdkafka/CONFIGURATION.md +29 -9
- package/deps/librdkafka/INTRODUCTION.md +909 -601
- package/deps/librdkafka/Makefile +2 -1
- package/deps/librdkafka/configure +0 -0
- package/deps/librdkafka/debian/rules +0 -0
- package/deps/librdkafka/dev-conf.sh +0 -0
- package/deps/librdkafka/examples/consumer.c +18 -8
- package/deps/librdkafka/examples/describe_consumer_groups.c +25 -6
- package/deps/librdkafka/examples/incremental_alter_configs.c +4 -5
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +26 -42
- package/deps/librdkafka/examples/openssl_engine_example.cpp +3 -4
- package/deps/librdkafka/examples/producer.cpp +2 -2
- package/deps/librdkafka/examples/user_scram.c +4 -5
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +4 -3
- package/deps/librdkafka/lds-gen.py +0 -0
- package/deps/librdkafka/mklove/Makefile.base +0 -0
- package/deps/librdkafka/packaging/RELEASE.md +8 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +0 -0
- package/deps/librdkafka/packaging/cp/README.md +4 -1
- package/deps/librdkafka/packaging/cp/check_features.c +12 -4
- package/deps/librdkafka/packaging/cp/verify-deb.sh +6 -6
- package/deps/librdkafka/packaging/cp/verify-packages.sh +52 -31
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +6 -13
- package/deps/librdkafka/packaging/debian/docs +5 -0
- package/deps/librdkafka/packaging/debian/rules +0 -0
- package/deps/librdkafka/packaging/get_version.py +0 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +0 -0
- package/deps/librdkafka/packaging/mingw-w64/{travis-before-install.sh → export-variables.sh} +0 -7
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +1 -1
- package/deps/librdkafka/packaging/nuget/artifact.py +0 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +0 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/release.py +0 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -3
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +3 -1
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +0 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +0 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +0 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +0 -0
- package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
- package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
- package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
- package/deps/librdkafka/packaging/tools/style-format.sh +6 -5
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +154 -0
- package/deps/librdkafka/src/generate_proto.sh +0 -0
- package/deps/librdkafka/src/rd.h +145 -2
- package/deps/librdkafka/src/rdaddr.h +6 -7
- package/deps/librdkafka/src/rdatomic.h +15 -11
- package/deps/librdkafka/src/rdavg.h +3 -2
- package/deps/librdkafka/src/rdbase64.c +33 -2
- package/deps/librdkafka/src/rdbase64.h +2 -0
- package/deps/librdkafka/src/rdendian.h +10 -9
- package/deps/librdkafka/src/rdhttp.c +418 -100
- package/deps/librdkafka/src/rdhttp.h +23 -5
- package/deps/librdkafka/src/rdkafka.c +299 -145
- package/deps/librdkafka/src/rdkafka.h +89 -6
- package/deps/librdkafka/src/rdkafka_admin.c +482 -105
- package/deps/librdkafka/src/rdkafka_admin.h +42 -0
- package/deps/librdkafka/src/rdkafka_broker.c +463 -312
- package/deps/librdkafka/src/rdkafka_broker.h +68 -10
- package/deps/librdkafka/src/rdkafka_buf.c +8 -5
- package/deps/librdkafka/src/rdkafka_buf.h +4 -3
- package/deps/librdkafka/src/rdkafka_cert.c +25 -1
- package/deps/librdkafka/src/rdkafka_cert.h +4 -3
- package/deps/librdkafka/src/rdkafka_cgrp.c +468 -143
- package/deps/librdkafka/src/rdkafka_cgrp.h +36 -2
- package/deps/librdkafka/src/rdkafka_conf.c +526 -102
- package/deps/librdkafka/src/rdkafka_conf.h +68 -4
- package/deps/librdkafka/src/rdkafka_feature.c +472 -35
- package/deps/librdkafka/src/rdkafka_feature.h +2 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +22 -2
- package/deps/librdkafka/src/rdkafka_fetcher.h +2 -2
- package/deps/librdkafka/src/rdkafka_int.h +84 -46
- package/deps/librdkafka/src/rdkafka_metadata.c +221 -136
- package/deps/librdkafka/src/rdkafka_metadata.h +15 -11
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +279 -73
- package/deps/librdkafka/src/rdkafka_mock.c +795 -19
- package/deps/librdkafka/src/rdkafka_mock.h +119 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1298 -132
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +345 -49
- package/deps/librdkafka/src/rdkafka_mock_int.h +180 -61
- package/deps/librdkafka/src/rdkafka_msg.c +35 -19
- package/deps/librdkafka/src/rdkafka_msg.h +3 -3
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +14 -10
- package/deps/librdkafka/src/rdkafka_offset.c +33 -5
- package/deps/librdkafka/src/rdkafka_op.c +1 -1
- package/deps/librdkafka/src/rdkafka_op.h +45 -21
- package/deps/librdkafka/src/rdkafka_partition.c +118 -23
- package/deps/librdkafka/src/rdkafka_partition.h +16 -7
- package/deps/librdkafka/src/rdkafka_proto.h +4 -1
- package/deps/librdkafka/src/rdkafka_protocol.h +1 -0
- package/deps/librdkafka/src/rdkafka_queue.c +125 -48
- package/deps/librdkafka/src/rdkafka_queue.h +19 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1 -1
- package/deps/librdkafka/src/rdkafka_request.c +336 -64
- package/deps/librdkafka/src/rdkafka_request.h +24 -1
- package/deps/librdkafka/src/rdkafka_sasl.c +5 -3
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +14 -10
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1166 -89
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +13 -3
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +3 -3
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +4 -3
- package/deps/librdkafka/src/rdkafka_ssl.c +306 -81
- package/deps/librdkafka/src/rdkafka_ssl.h +22 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +80 -23
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +5 -1
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +20 -20
- package/deps/librdkafka/src/rdkafka_topic.c +220 -137
- package/deps/librdkafka/src/rdkafka_topic.h +14 -8
- package/deps/librdkafka/src/rdkafka_transport.c +59 -47
- package/deps/librdkafka/src/rdkafka_transport.h +5 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +6 -1
- package/deps/librdkafka/src/rdmap.c +6 -1
- package/deps/librdkafka/src/rdrand.c +11 -1
- package/deps/librdkafka/src/rdtime.h +48 -17
- package/deps/librdkafka/src/rdunittest.c +42 -25
- package/deps/librdkafka/src/rdunittest.h +2 -0
- package/deps/librdkafka/src/rdwin32.h +1 -1
- package/deps/librdkafka/src/regexp.c +47 -42
- package/deps/librdkafka/src/tinycthread_extra.c +45 -21
- package/deps/librdkafka/src/tinycthread_extra.h +7 -3
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +28 -2
- package/deps/librdkafka/tests/0001-multiobj.c +4 -0
- package/deps/librdkafka/tests/0004-conf.c +103 -36
- package/deps/librdkafka/tests/0009-mock_cluster.c +1 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +2 -1
- package/deps/librdkafka/tests/0016-client_swname.c +18 -3
- package/deps/librdkafka/tests/0017-compression.c +6 -8
- package/deps/librdkafka/tests/0018-cgrp_term.c +8 -3
- package/deps/librdkafka/tests/0021-rkt_destroy.c +1 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +4 -1
- package/deps/librdkafka/tests/0026-consume_pause.c +12 -14
- package/deps/librdkafka/tests/0028-long_topicnames.c +1 -1
- package/deps/librdkafka/tests/0029-assign_offset.c +6 -8
- package/deps/librdkafka/tests/0030-offset_commit.c +2 -2
- package/deps/librdkafka/tests/0033-regex_subscribe.c +33 -17
- package/deps/librdkafka/tests/0034-offset_reset.c +25 -4
- package/deps/librdkafka/tests/0036-partial_fetch.c +1 -0
- package/deps/librdkafka/tests/0038-performance.c +1 -0
- package/deps/librdkafka/tests/0040-io_event.c +11 -5
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +1 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +3 -2
- package/deps/librdkafka/tests/0045-subscribe_update.c +284 -20
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +1 -0
- package/deps/librdkafka/tests/0048-partitioner.c +1 -1
- package/deps/librdkafka/tests/0050-subscribe_adds.c +1 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +1 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +22 -4
- package/deps/librdkafka/tests/0053-stats_cb.cpp +12 -20
- package/deps/librdkafka/tests/0055-producer_latency.c +176 -3
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +6 -2
- package/deps/librdkafka/tests/0058-log.cpp +3 -3
- package/deps/librdkafka/tests/0059-bsearch.cpp +8 -4
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +25 -5
- package/deps/librdkafka/tests/0067-empty_topic.cpp +3 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +21 -23
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +3 -7
- package/deps/librdkafka/tests/0075-retry.c +38 -1
- package/deps/librdkafka/tests/0076-produce_retry.c +2 -0
- package/deps/librdkafka/tests/0077-compaction.c +8 -2
- package/deps/librdkafka/tests/0080-admin_ut.c +34 -4
- package/deps/librdkafka/tests/0081-admin.c +455 -155
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +4 -0
- package/deps/librdkafka/tests/0083-cb_event.c +8 -3
- package/deps/librdkafka/tests/0084-destroy_flags.c +14 -18
- package/deps/librdkafka/tests/0085-headers.cpp +4 -0
- package/deps/librdkafka/tests/0086-purge.c +40 -7
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +1 -1
- package/deps/librdkafka/tests/0089-max_poll_interval.c +12 -7
- package/deps/librdkafka/tests/0090-idempotence.c +1 -2
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +5 -7
- package/deps/librdkafka/tests/0092-mixed_msgver.c +6 -0
- package/deps/librdkafka/tests/0093-holb.c +8 -5
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +1 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +262 -70
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +16 -16
- package/deps/librdkafka/tests/0099-commit_metadata.c +1 -1
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +1 -1
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +317 -16
- package/deps/librdkafka/tests/0103-transactions.c +7 -7
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +1 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +18 -11
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +35 -14
- package/deps/librdkafka/tests/0107-topic_recreate.c +2 -2
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +86 -26
- package/deps/librdkafka/tests/0110-batch_size.cpp +1 -2
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +3 -14
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +248 -104
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +3 -3
- package/deps/librdkafka/tests/0115-producer_auth.cpp +4 -1
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +7 -5
- package/deps/librdkafka/tests/0117-mock_errors.c +15 -5
- package/deps/librdkafka/tests/0118-commit_rebalance.c +41 -8
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +20 -1
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +8 -3
- package/deps/librdkafka/tests/0125-immediate_flush.c +1 -1
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +323 -8
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +1 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +12 -4
- package/deps/librdkafka/tests/0133-ssl_keys.c +28 -6
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +24 -14
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +510 -2
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +1 -1
- package/deps/librdkafka/tests/0142-reauthentication.c +37 -17
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +39 -40
- package/deps/librdkafka/tests/0146-metadata_mock.c +76 -15
- package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
- package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
- package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
- package/deps/librdkafka/tests/0150-telemetry_mock.c +9 -6
- package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
- package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
- package/deps/librdkafka/tests/0153-memberid.c +128 -0
- package/deps/librdkafka/tests/CMakeLists.txt +6 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +34 -9
- package/deps/librdkafka/tests/autotest.sh +0 -0
- package/deps/librdkafka/tests/broker_version_tests.py +0 -0
- package/deps/librdkafka/tests/buildbox.sh +0 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +0 -0
- package/deps/librdkafka/tests/cluster_testing.py +0 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +0 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +42 -101
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +41 -29
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +112 -37
- package/deps/librdkafka/tests/gen-ssl-certs.sh +0 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +0 -0
- package/deps/librdkafka/tests/java/Makefile +2 -1
- package/deps/librdkafka/tests/java/run-class.sh +0 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +0 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +0 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +0 -0
- package/deps/librdkafka/tests/performance_plot.py +0 -0
- package/deps/librdkafka/tests/requirements.txt +1 -1
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +0 -0
- package/deps/librdkafka/tests/sasl_test.py +0 -0
- package/deps/librdkafka/tests/test.c +478 -18
- package/deps/librdkafka/tests/test.h +62 -13
- package/deps/librdkafka/tests/testcpp.cpp +6 -1
- package/deps/librdkafka/tests/testcpp.h +30 -2
- package/deps/librdkafka/tests/testshared.h +16 -2
- package/deps/librdkafka/tests/tools/stats/graph.py +0 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +1 -1
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +0 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +1 -1
- package/deps/librdkafka/vcpkg.json +1 -1
- package/deps/librdkafka/win32/setup-msys2.ps1 +24 -8
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +28 -6
- package/deps/librdkafka/win32/tests/tests.vcxproj +6 -0
- package/deps/librdkafka/win32/wingetopt.h +5 -4
- package/errors.d.ts +27 -1
- package/lib/error.js +29 -3
- package/make_docs.sh +0 -0
- package/package.json +12 -13
- package/run_docker.sh +0 -0
- package/src/callbacks.cc +6 -9
- package/src/callbacks.h +1 -5
- package/test/kafka-consumer-worker.js +10 -7
- package/test/kafka-consumer.spec.js +32 -21
- package/deps/librdkafka/.semaphore/project.yml +0 -43
- package/deps/librdkafka/.semaphore/project_public.yml +0 -20
- package/deps/librdkafka/win32/install-openssl.ps1 +0 -33
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2020-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -55,7 +56,7 @@ static void rebalance_cb(rd_kafka_t *rk,
|
|
|
55
56
|
rd_kafka_err2name(rebalance_exp_event), rd_kafka_err2name(err));
|
|
56
57
|
|
|
57
58
|
if (err == RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS) {
|
|
58
|
-
|
|
59
|
+
test_consumer_assign_by_rebalance_protocol("assign", rk, parts);
|
|
59
60
|
} else {
|
|
60
61
|
rd_kafka_resp_err_t commit_err;
|
|
61
62
|
|
|
@@ -92,8 +93,8 @@ static void rebalance_cb(rd_kafka_t *rk,
|
|
|
92
93
|
rd_kafka_err2name(commit_exp_err),
|
|
93
94
|
rd_kafka_err2name(commit_err));
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
test_consumer_unassign_by_rebalance_protocol("unassign", rk,
|
|
97
|
+
parts);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
/* Make sure only one rebalance callback is served per poll()
|
|
@@ -169,21 +170,26 @@ static void do_test_session_timeout(const char *use_commit_type) {
|
|
|
169
170
|
test_conf_set(conf, "auto.offset.reset", "earliest");
|
|
170
171
|
test_conf_set(conf, "enable.auto.commit",
|
|
171
172
|
!strcmp(commit_type, "auto") ? "true" : "false");
|
|
173
|
+
rd_kafka_mock_set_group_consumer_session_timeout_ms(mcluster, 1000);
|
|
174
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster, 100);
|
|
172
175
|
|
|
173
176
|
c = test_create_consumer(groupid, rebalance_cb, conf, NULL);
|
|
174
177
|
|
|
175
178
|
test_consumer_subscribe(c, topic);
|
|
176
179
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
if (test_consumer_group_protocol_classic()) {
|
|
181
|
+
/* Let Heartbeats fail after a couple of successful ones */
|
|
182
|
+
rd_kafka_mock_push_request_errors(
|
|
183
|
+
mcluster, RD_KAFKAP_Heartbeat, 9,
|
|
184
|
+
RD_KAFKA_RESP_ERR_NO_ERROR, RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
185
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR,
|
|
186
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR,
|
|
187
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR,
|
|
188
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR,
|
|
189
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR,
|
|
190
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR,
|
|
191
|
+
RD_KAFKA_RESP_ERR_NOT_COORDINATOR);
|
|
192
|
+
}
|
|
187
193
|
|
|
188
194
|
expect_rebalance("initial assignment", c,
|
|
189
195
|
RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS, 5 + 2);
|
|
@@ -191,6 +197,12 @@ static void do_test_session_timeout(const char *use_commit_type) {
|
|
|
191
197
|
/* Consume a couple of messages so that we have something to commit */
|
|
192
198
|
test_consumer_poll("consume", c, 0, -1, 0, 10, NULL);
|
|
193
199
|
|
|
200
|
+
if (!test_consumer_group_protocol_classic()) {
|
|
201
|
+
/* Increase HB interval so member is fenced from the group */
|
|
202
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster,
|
|
203
|
+
2000);
|
|
204
|
+
}
|
|
205
|
+
|
|
194
206
|
/* The commit in the rebalance callback should fail when the
|
|
195
207
|
* member has timed out from the group. */
|
|
196
208
|
commit_exp_err = RD_KAFKA_RESP_ERR_UNKNOWN_MEMBER_ID;
|
|
@@ -291,7 +303,16 @@ int main_0106_cgrp_sess_timeout(int argc, char **argv) {
|
|
|
291
303
|
do_test_session_timeout("async");
|
|
292
304
|
do_test_session_timeout("auto");
|
|
293
305
|
|
|
294
|
-
|
|
306
|
+
/* With KIP-848 session timeout is remote only.
|
|
307
|
+
* Partitions will stay assigned and fetchable
|
|
308
|
+
* when there's no communication with the
|
|
309
|
+
* coordinator, but the messages won't be
|
|
310
|
+
* committed.
|
|
311
|
+
* TODO: see if session timeout can be received by
|
|
312
|
+
* the broker and be enforced locally too. */
|
|
313
|
+
if (test_consumer_group_protocol_classic()) {
|
|
314
|
+
do_test_commit_on_lost();
|
|
315
|
+
}
|
|
295
316
|
|
|
296
317
|
return 0;
|
|
297
318
|
}
|
|
@@ -189,7 +189,7 @@ static void do_test_create_delete_create(int part_cnt_1, int part_cnt_2) {
|
|
|
189
189
|
consumer = test_create_consumer(topic, NULL, NULL, NULL);
|
|
190
190
|
|
|
191
191
|
/* Create topic */
|
|
192
|
-
|
|
192
|
+
test_create_topic_wait_exists(consumer, topic, part_cnt_1, 3, 5000);
|
|
193
193
|
|
|
194
194
|
/* Start consumer */
|
|
195
195
|
test_consumer_subscribe(consumer, topic);
|
|
@@ -216,7 +216,7 @@ static void do_test_create_delete_create(int part_cnt_1, int part_cnt_2) {
|
|
|
216
216
|
rd_sleep(5);
|
|
217
217
|
|
|
218
218
|
/* Re-create topic */
|
|
219
|
-
|
|
219
|
+
test_create_topic_wait_exists(consumer, topic, part_cnt_2, 3, 5000);
|
|
220
220
|
|
|
221
221
|
mtx_lock(&value_mtx);
|
|
222
222
|
value = "after";
|
|
@@ -39,21 +39,39 @@
|
|
|
39
39
|
* The same test is run with and without allow.auto.create.topics
|
|
40
40
|
* and with and without wildcard subscribes.
|
|
41
41
|
*
|
|
42
|
+
* With the KIP 848 consumer group protocol, topics aren't automatically
|
|
43
|
+
* created when subscribing and the topic authorization error
|
|
44
|
+
* applies to the whole subscription, not just the unauthorized topics.
|
|
42
45
|
*/
|
|
43
46
|
|
|
44
47
|
|
|
45
48
|
static void do_test_consumer(bool allow_auto_create_topics,
|
|
46
|
-
bool with_wildcards
|
|
49
|
+
bool with_wildcards,
|
|
50
|
+
bool test_unauthorized_topic) {
|
|
47
51
|
Test::Say(tostr() << _C_MAG << "[ Test allow.auto.create.topics="
|
|
48
52
|
<< (allow_auto_create_topics ? "true" : "false")
|
|
49
53
|
<< " with_wildcards=" << (with_wildcards ? "true" : "false")
|
|
50
|
-
<< "
|
|
54
|
+
<< " test_unauthorized_topic="
|
|
55
|
+
<< (test_unauthorized_topic ? "true" : "false") << " ]\n");
|
|
51
56
|
|
|
52
57
|
bool has_acl_cli = test_broker_version >= TEST_BRKVER(2, 1, 0, 0) &&
|
|
53
58
|
!test_needs_auth(); /* We can't bother passing Java
|
|
54
59
|
* security config to kafka-acls.sh */
|
|
60
|
+
if (test_unauthorized_topic && !has_acl_cli) {
|
|
61
|
+
Test::Say(
|
|
62
|
+
"Skipping unauthorized topic test since kafka-acls.sh is not "
|
|
63
|
+
"available\n");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!test_consumer_group_protocol_classic() && allow_auto_create_topics) {
|
|
67
|
+
Test::Say(
|
|
68
|
+
"Skipping test as it would be duplicate "
|
|
69
|
+
"with KIP 848 consumer protocol\n");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
55
72
|
|
|
56
73
|
bool supports_allow = test_broker_version >= TEST_BRKVER(0, 11, 0, 0);
|
|
74
|
+
const int cgrp_consumer_expected_consecutive_error_cnt = 3;
|
|
57
75
|
|
|
58
76
|
std::string topic_exists = Test::mk_topic_name("0109-exists", 1);
|
|
59
77
|
std::string topic_notexists = Test::mk_topic_name("0109-notexists", 1);
|
|
@@ -83,7 +101,7 @@ static void do_test_consumer(bool allow_auto_create_topics,
|
|
|
83
101
|
/* Create topics */
|
|
84
102
|
Test::create_topic(c, topic_exists.c_str(), 1, 1);
|
|
85
103
|
|
|
86
|
-
if (
|
|
104
|
+
if (test_unauthorized_topic) {
|
|
87
105
|
Test::create_topic(c, topic_unauth.c_str(), 1, 1);
|
|
88
106
|
|
|
89
107
|
/* Add denying ACL for unauth topic */
|
|
@@ -107,34 +125,50 @@ static void do_test_consumer(bool allow_auto_create_topics,
|
|
|
107
125
|
std::map<std::string, RdKafka::ErrorCode> exp_errors;
|
|
108
126
|
|
|
109
127
|
topics.push_back(topic_notexists);
|
|
110
|
-
|
|
128
|
+
|
|
129
|
+
if (test_unauthorized_topic)
|
|
111
130
|
topics.push_back(topic_unauth);
|
|
112
131
|
|
|
113
132
|
if (with_wildcards) {
|
|
114
133
|
topics.push_back("^" + topic_exists);
|
|
115
134
|
topics.push_back("^" + topic_notexists);
|
|
116
|
-
/* If the subscription contains at least one wildcard/regex
|
|
117
|
-
* then no auto topic creation will take place (since the consumer
|
|
118
|
-
* requests all topics in metadata, and not specific ones, thus
|
|
119
|
-
* not triggering topic auto creation).
|
|
120
|
-
* We need to handle the expected error cases accordingly. */
|
|
121
|
-
exp_errors["^" + topic_notexists] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
122
|
-
exp_errors[topic_notexists] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
123
|
-
|
|
124
|
-
if (has_acl_cli) {
|
|
125
|
-
/* Unauthorized topics are not included in list-all-topics Metadata,
|
|
126
|
-
* which we use for wildcards, so in this case the error code for
|
|
127
|
-
* unauthorixed topics show up as unknown topic. */
|
|
128
|
-
exp_errors[topic_unauth] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
129
|
-
}
|
|
130
135
|
} else {
|
|
131
136
|
topics.push_back(topic_exists);
|
|
137
|
+
}
|
|
132
138
|
|
|
133
|
-
|
|
139
|
+
/* `classic` protocol case: if the subscription contains at least one
|
|
140
|
+
* wildcard/regex then no auto topic creation will take place (since the
|
|
141
|
+
* consumer requests all topics in metadata, and not specific ones, thus not
|
|
142
|
+
* triggering topic auto creation). We need to handle the expected error cases
|
|
143
|
+
* accordingly.
|
|
144
|
+
*
|
|
145
|
+
* `consumer` protocol case: there's no automatic topic creation. */
|
|
146
|
+
if (test_consumer_group_protocol_classic()) {
|
|
147
|
+
if (with_wildcards) {
|
|
148
|
+
exp_errors["^" + topic_notexists] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
149
|
+
exp_errors[topic_notexists] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
150
|
+
if (test_unauthorized_topic) {
|
|
151
|
+
/* Unauthorized topics are not included in list-all-topics Metadata,
|
|
152
|
+
* which we use for wildcards, so in this case the error code for
|
|
153
|
+
* unauthorixed topics show up as unknown topic. */
|
|
154
|
+
exp_errors[topic_unauth] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
155
|
+
}
|
|
156
|
+
} else if (test_unauthorized_topic) {
|
|
134
157
|
exp_errors[topic_unauth] = RdKafka::ERR_TOPIC_AUTHORIZATION_FAILED;
|
|
158
|
+
}
|
|
159
|
+
} else if (test_unauthorized_topic) {
|
|
160
|
+
/* Authorization errors happen if even a single topic
|
|
161
|
+
* is unauthorized and an error is returned for the whole subscription
|
|
162
|
+
* without reference to the topic. */
|
|
163
|
+
exp_errors[""] = RdKafka::ERR_TOPIC_AUTHORIZATION_FAILED;
|
|
135
164
|
}
|
|
136
165
|
|
|
137
|
-
if
|
|
166
|
+
/* `classic` protocol case: expect an error only if the broker supports the
|
|
167
|
+
* property and the test disallowed it.
|
|
168
|
+
*
|
|
169
|
+
* `consumer` protocol case: there's no automatic topic creation. */
|
|
170
|
+
if (supports_allow && !allow_auto_create_topics &&
|
|
171
|
+
test_consumer_group_protocol_classic())
|
|
138
172
|
exp_errors[topic_notexists] = RdKafka::ERR_UNKNOWN_TOPIC_OR_PART;
|
|
139
173
|
|
|
140
174
|
RdKafka::ErrorCode err;
|
|
@@ -143,7 +177,8 @@ static void do_test_consumer(bool allow_auto_create_topics,
|
|
|
143
177
|
|
|
144
178
|
/* Start consuming until EOF is reached, which indicates that we have an
|
|
145
179
|
* assignment and any errors should have been reported. */
|
|
146
|
-
bool run
|
|
180
|
+
bool run = true;
|
|
181
|
+
int consecutive_error_cnt = 0;
|
|
147
182
|
while (run) {
|
|
148
183
|
RdKafka::Message *msg = c->consume(tmout_multip(1000));
|
|
149
184
|
switch (msg->err()) {
|
|
@@ -155,6 +190,17 @@ static void do_test_consumer(bool allow_auto_create_topics,
|
|
|
155
190
|
run = false;
|
|
156
191
|
break;
|
|
157
192
|
|
|
193
|
+
case RdKafka::ERR_TOPIC_AUTHORIZATION_FAILED:
|
|
194
|
+
if (test_consumer_group_protocol_classic()) {
|
|
195
|
+
run = true;
|
|
196
|
+
} else {
|
|
197
|
+
/* `consumer` rebalance protocol:
|
|
198
|
+
* wait for `unauthorized_error_cnt` consecutive errors. */
|
|
199
|
+
run = (++consecutive_error_cnt) <
|
|
200
|
+
cgrp_consumer_expected_consecutive_error_cnt;
|
|
201
|
+
}
|
|
202
|
+
/* FALLTHRU */
|
|
203
|
+
|
|
158
204
|
default:
|
|
159
205
|
Test::Say("Consume error on " + msg->topic_name() + ": " + msg->errstr() +
|
|
160
206
|
"\n");
|
|
@@ -186,6 +232,13 @@ static void do_test_consumer(bool allow_auto_create_topics,
|
|
|
186
232
|
RdKafka::err2str(msg->err()));
|
|
187
233
|
} else {
|
|
188
234
|
exp_errors.erase(msg->topic_name());
|
|
235
|
+
if (!test_consumer_group_protocol_classic() &&
|
|
236
|
+
test_unauthorized_topic &&
|
|
237
|
+
consecutive_error_cnt <
|
|
238
|
+
cgrp_consumer_expected_consecutive_error_cnt) {
|
|
239
|
+
/* Expect same error on next HB */
|
|
240
|
+
exp_errors[""] = RdKafka::ERR_TOPIC_AUTHORIZATION_FAILED;
|
|
241
|
+
}
|
|
189
242
|
}
|
|
190
243
|
|
|
191
244
|
break;
|
|
@@ -207,11 +260,18 @@ static void do_test_consumer(bool allow_auto_create_topics,
|
|
|
207
260
|
extern "C" {
|
|
208
261
|
int main_0109_auto_create_topics(int argc, char **argv) {
|
|
209
262
|
/* Parameters:
|
|
210
|
-
* allow auto create, with wildcards */
|
|
211
|
-
do_test_consumer(true,
|
|
212
|
-
do_test_consumer(
|
|
213
|
-
|
|
214
|
-
do_test_consumer(
|
|
263
|
+
* allow auto create, with wildcards, test unauthorized topic */
|
|
264
|
+
do_test_consumer(true, false, false);
|
|
265
|
+
do_test_consumer(false, false, false);
|
|
266
|
+
|
|
267
|
+
do_test_consumer(true, true, false);
|
|
268
|
+
do_test_consumer(false, true, false);
|
|
269
|
+
|
|
270
|
+
do_test_consumer(true, false, true);
|
|
271
|
+
do_test_consumer(false, false, true);
|
|
272
|
+
|
|
273
|
+
do_test_consumer(true, true, true);
|
|
274
|
+
do_test_consumer(false, true, true);
|
|
215
275
|
|
|
216
276
|
return 0;
|
|
217
277
|
}
|
|
@@ -154,8 +154,7 @@ static void do_test_batch_size() {
|
|
|
154
154
|
while (event_cb.avg_batchsize == 0)
|
|
155
155
|
p->poll(1000);
|
|
156
156
|
|
|
157
|
-
Test::Say(tostr() << "Batchsize: "
|
|
158
|
-
<< "configured " << batchsize << ", min "
|
|
157
|
+
Test::Say(tostr() << "Batchsize: " << "configured " << batchsize << ", min "
|
|
159
158
|
<< event_cb.min_batchsize << ", max "
|
|
160
159
|
<< event_cb.max_batchsize << ", avg "
|
|
161
160
|
<< event_cb.avg_batchsize << "\n");
|
|
@@ -43,7 +43,6 @@ int main_0112_assign_unknown_part(int argc, char **argv) {
|
|
|
43
43
|
uint64_t testid = test_id_generate();
|
|
44
44
|
rd_kafka_t *c;
|
|
45
45
|
rd_kafka_topic_partition_list_t *tpl;
|
|
46
|
-
int r;
|
|
47
46
|
|
|
48
47
|
test_conf_init(NULL, NULL, 60);
|
|
49
48
|
|
|
@@ -51,8 +50,7 @@ int main_0112_assign_unknown_part(int argc, char **argv) {
|
|
|
51
50
|
c = test_create_consumer(topic, NULL, NULL, NULL);
|
|
52
51
|
|
|
53
52
|
TEST_SAY("Creating topic %s with 1 partition\n", topic);
|
|
54
|
-
|
|
55
|
-
test_wait_topic_exists(c, topic, 10 * 1000);
|
|
53
|
+
test_create_topic_wait_exists(c, topic, 1, 1, 10 * 1000);
|
|
56
54
|
|
|
57
55
|
TEST_SAY("Producing message to partition 0\n");
|
|
58
56
|
test_produce_msgs_easy(topic, testid, 0, 1);
|
|
@@ -68,17 +66,8 @@ int main_0112_assign_unknown_part(int argc, char **argv) {
|
|
|
68
66
|
TEST_SAY("Changing partition count for topic %s\n", topic);
|
|
69
67
|
test_create_partitions(NULL, topic, 2);
|
|
70
68
|
|
|
71
|
-
/*
|
|
72
|
-
|
|
73
|
-
* which causes the produce to fail.
|
|
74
|
-
* Loop until the partition count is correct. */
|
|
75
|
-
while ((r = test_get_partition_count(c, topic, 5000)) != 2) {
|
|
76
|
-
TEST_SAY(
|
|
77
|
-
"Waiting for %s partition count to reach 2, "
|
|
78
|
-
"currently %d\n",
|
|
79
|
-
topic, r);
|
|
80
|
-
rd_sleep(1);
|
|
81
|
-
}
|
|
69
|
+
/* Allow the partition to propagate */
|
|
70
|
+
rd_sleep(1);
|
|
82
71
|
|
|
83
72
|
TEST_SAY("Producing message to partition 1\n");
|
|
84
73
|
test_produce_msgs_easy(topic, testid, 1, 1);
|