Skip to content

rgw/multisite: remove old zonegroup name on the remote zone after a rename - #68033

Merged
smanjara merged 4 commits into
ceph:mainfrom
smanjara:wip-zg-rename
Apr 20, 2026
Merged

smanjara merged 4 commits into
ceph:mainfrom
smanjara:wip-zg-rename

Conversation

@smanjara

Copy link
Copy Markdown
Contributor

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Shilpa Jagannath added 4 commits March 26, 2026 03:46
…te_period() function.

calling it twice for the same epoch in RGWOp_Period_Post, resulted in a -EEXIST response to the
second call. as a result reflect_period() which updates the local objects and period history
update was being skipped.

Signed-off-by: Shilpa Jagannath <[email protected]>
update_latest_epoch() calls correctly

Signed-off-by: Shilpa Jagannath <[email protected]>
@smanjara

Copy link
Copy Markdown
Contributor Author

@cbodley I wasn't able to reopen #65651. you had mostly reviewed everything, but could you please look over the update_latest_epoch() calls again? thanks!

@BBoozmen BBoozmen added the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Apr 15, 2026
@anrao19

anrao19 commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Pr testing completed and approved by @ivancich, More details in : https://tracker.ceph.com/issues/76032.
@smanjara , if no further testing needed we can merge this pr

@BBoozmen BBoozmen removed the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Apr 20, 2026
@smanjara
smanjara merged commit bcedb60 into ceph:main Apr 20, 2026
6 of 7 checks passed
thuvh added a commit to thuvh/ceph that referenced this pull request Nov 23, 2026
Tracker ceph#69566 asks for a test covering the scenario where a Kafka
broker rejects topic creation -- e.g. the topic already exists with
conflicting ACLs. That is the same path that caused the crash in ceph#68033,
where rd_kafka_topic_name() was called on a NULL rd_kafka_topic_t*. The
crash itself was fixed in PR ceph#59741, but the post-fix branch in
rgw_kafka.cc (publish_internal invoking the callback with a negative
errno when rd_kafka_topic_new() returns NULL) was never exercised by an
automated test: there was not even a C++ unit test for rgw_kafka, unlike
the analogous amqp endpoint.

Add a controllable kafka_mock (replacing the no-op kafka_stub) and a
unittest_rgw_kafka modeled on unittest_rgw_amqp. The mock lets tests
force rd_kafka_topic_new() / rd_kafka_produce() to fail and toggle
ack/nack on poll. The TopicCreationFailure test forces
RD_KAFKA_RESP_ERR_TOPIC_ALREADY_EXISTS and asserts the publish callback
fires with a negative errno and no crash, so any future regression that
revisits the NULL topic handle will surface in CI.

Fixes: https://tracker.ceph.com/issues/69566
Related: https://tracker.ceph.com/issues/68033
Signed-off-by: Hoai-Thu Vuong <[email protected]>
thuvh added a commit to thuvh/ceph that referenced this pull request Nov 30, 2026
Tracker ceph#69566 asks for a test covering the scenario where a Kafka
broker rejects topic creation -- e.g. the topic already exists with
conflicting ACLs. That is the same path that caused the crash in ceph#68033,
where rd_kafka_topic_name() was called on a NULL rd_kafka_topic_t*. The
crash itself was fixed in PR ceph#59741, but the post-fix branch in
rgw_kafka.cc (publish_internal invoking the callback with a negative
errno when rd_kafka_topic_new() returns NULL) was never exercised by an
automated test: there was not even a C++ unit test for rgw_kafka, unlike
the analogous amqp endpoint.

Add a controllable kafka_mock and a unittest_rgw_kafka modeled on
unittest_rgw_amqp. The mock lets tests force rd_kafka_topic_new() /
rd_kafka_produce() to fail and toggle ack/nack on poll. The
TopicCreationFailure test forces RD_KAFKA_RESP_ERR_TOPIC_ALREADY_EXISTS
and asserts the publish callback fires with a negative errno and no
crash, so any future regression that revisits the NULL topic handle will
surface in CI.

The existing kafka_stub is kept unchanged as the link-fallback for other
RGW test binaries. The mock and the stub define the same rd_kafka_*
symbols and so cannot coexist in one binary: unittest_rgw_kafka drops
kafka_stub from its lib list (list(REMOVE_ITEM)) and links kafka_mock
instead. No other test binary's link behavior changes.

Fixes: https://tracker.ceph.com/issues/69566
Related: https://tracker.ceph.com/issues/68033
Signed-off-by: Hoai-Thu Vuong <[email protected]>
thuvh added a commit to thuvh/ceph that referenced this pull request Nov 30, 2026
Tracker ceph#69566 asks for a test covering the scenario where a Kafka
broker rejects topic creation -- e.g. the topic already exists with
conflicting ACLs. That is the same path that caused the crash in ceph#68033,
where rd_kafka_topic_name() was called on a NULL rd_kafka_topic_t*. The
crash itself was fixed in PR ceph#59741, but the post-fix branch in
rgw_kafka.cc (publish_internal invoking the callback with a negative
errno when rd_kafka_topic_new() returns NULL) was never exercised by an
automated test: there was not even a C++ unit test for rgw_kafka, unlike
the analogous amqp endpoint.

Add a controllable kafka_mock and a unittest_rgw_kafka modeled on
unittest_rgw_amqp. The mock lets tests force rd_kafka_topic_new() /
rd_kafka_produce() to fail and toggle ack/nack on poll. The
TopicCreationFailure test forces RD_KAFKA_RESP_ERR_TOPIC_ALREADY_EXISTS
and asserts the publish callback fires with a negative errno and no
crash, so any future regression that revisits the NULL topic handle will
surface in CI.

The existing kafka_stub is kept as the high-priority link-fallback for
general RGW test binaries, and is made link-compatible with the mock by
declaring its rd_kafka_* symbols weak. The mock's strong symbols
override the stub's weak ones when both are linked into the same binary
(unittest_rgw_kafka links ${rgw_libs} kafka_mock), so the two libraries
coexist with no list surgery and no multiple-definition conflict. Tests
that link only the stub keep its no-op behavior unchanged.

Fixes: https://tracker.ceph.com/issues/69566
Related: https://tracker.ceph.com/issues/68033
Signed-off-by: Hoai-Thu Vuong <[email protected]>
thuvh added a commit to thuvh/ceph that referenced this pull request Nov 30, 2026
Tracker ceph#69566 asks for a test covering the scenario where a Kafka
broker rejects topic creation -- e.g. the topic already exists with
conflicting ACLs. That is the same path that caused the crash in ceph#68033,
where rd_kafka_topic_name() was called on a NULL rd_kafka_topic_t*. The
crash itself was fixed in PR ceph#59741, but the post-fix branch in
rgw_kafka.cc (publish_internal invoking the callback with a negative
errno when rd_kafka_topic_new() returns NULL) was never exercised by an
automated test: there was not even a C++ unit test for rgw_kafka, unlike
the analogous amqp endpoint.

Add a controllable kafka_mock and a unittest_rgw_kafka modeled on
unittest_rgw_amqp. The mock lets tests force rd_kafka_topic_new() /
rd_kafka_produce() to fail and toggle ack/nack on poll. The
TopicCreationFailure test forces RD_KAFKA_RESP_ERR_TOPIC_ALREADY_EXISTS
and asserts the publish callback fires with a negative errno and no
crash, so any future regression that revisits the NULL topic handle will
surface in CI.

The existing kafka_stub is kept as the high-priority link-fallback for
general RGW test binaries (its no-op behavior is unchanged). The mock is
kept link-compatible with the stub by marking the stub's rd_kafka_*
symbols weak (__attribute__((weak))) so that, in principle, a
strong-definition mock can override them when both are linked together.
In practice, static-archive pull-in is order-dependent, so
unittest_rgw_kafka uses list(REMOVE_ITEM) to exclude kafka_stub from
its lib list and links kafka_mock instead; the weak attributes stay as
defense-in-depth documentation. No other test binary's link behavior
changes.

Fixes: https://tracker.ceph.com/issues/69566
Related: https://tracker.ceph.com/issues/68033
Signed-off-by: Hoai-Thu Vuong <[email protected]>
thuvh added a commit to thuvh/ceph that referenced this pull request Nov 30, 2026
Tracker ceph#69566 asks for a test covering the scenario where a Kafka
broker rejects the topic RGW tries to produce to -- e.g. the topic was
already created with conflicting ACLs. That is the same path that
caused the crash in ceph#68033, where rd_kafka_topic_name() was called on
a NULL rd_kafka_topic_t*. The crash itself was fixed in PR ceph#59741, but
the post-fix branch in rgw_kafka.cc (publish_internal invoking the
callback with a negative errno on broker rejection, instead of
dereferencing the topic handle) was never exercised by an automated
test: there was not even a C++ unit test for rgw_kafka, unlike the
analogous amqp endpoint.

Rather than hand-rolling a mock of the librdkafka C API (which would
duplicate librdkafka's own behavior for very little value), drive the
*real* librdkafka linked into RGW against librdkafka's in-process mock
cluster (rdkafka_mock.h, shipped with librdkafka >= 2.x; Ceph already
requires rdkafka >= 2.11). The mock cluster speaks the Kafka wire
protocol on localhost sockets, so rgw_kafka.cc exercises its real
producer-creation / topic-handle / produce / delivery-report paths.
rd_kafka_mock_topic_set_error() makes the broker return an error in
Metadata responses for a given topic; librdkafka surfaces that as a
produce delivery failure; rgw_kafka's post-ceph#59741 code fires the user
callback with a negative errno instead of crashing.

unittest_rgw_kafka covers:
  - TopicAuthorizationFailed: the ceph#69566 "already created with ACL"
    scenario (RD_KAFKA_RESP_ERR_TOPIC_AUTHORIZATION_FAILED in Metadata)
  - TopicAlreadyExists: the literal error in ceph#68033's description
  - PublishAck: the happy path, callback rc == 0
  - ProduceFailure: broker rejects the produce itself (ApiKey 0 /
    ProduceRequest via rd_kafka_mock_push_request_errors)

The existing kafka_stub is kept unchanged as the link-fallback for
other RGW test binaries. unittest_rgw_kafka links the real
RDKafka::RDKafka instead of kafka_stub (the two define the same
rd_kafka_* symbols so they cannot coexist in one binary): the stub is
dropped from its lib list via list(REMOVE_ITEM), as before. No other
test binary's link behavior changes.

Fixes: https://tracker.ceph.com/issues/69566
Related: https://tracker.ceph.com/issues/68033
Signed-off-by: Hoai-Thu Vuong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants