Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Conversation

@BewareMyPower
Copy link
Collaborator

@BewareMyPower BewareMyPower commented May 7, 2022

Motivation

Currently in KoP tests, the metadata namespace configured by
kafkaMetadataNamespace is "default", which is same with the default
namespace of Pulsar and KoP (kafkaNamespace).

kafkaConfig.setKafkaMetadataTenant(tenant);
kafkaConfig.setKafkaMetadataNamespace(namespace);

It's a terrible config because some topic policies might be changed with
the metadata namespace and the offset topic is created during starting.
We should avoid the namespace for normal topics being affected by these
implicit operations.

Modifications

Remove the configs for kafkaMetadataTenant and
kafkaMetadataNamespace, then fix the following tests:

  • MultiLedgerTest: set the infinite retention to avoid rollover
    ledgers being removed automatically.
  • KafkaTopicConsumerManagerTest: trigger the topic lookup before
    creating PersistentTopic objects in BrokerService so that broker
    can acquire the ownership of namespace bundles.
  • CacheInvalidatorTest: unload the metadata namespace instead of the
    default namespace.

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@BewareMyPower BewareMyPower requested review from a team and jiazhai as code owners May 7, 2022 08:08
@BewareMyPower BewareMyPower marked this pull request as draft May 7, 2022 08:08
@github-actions github-actions bot added the no-need-doc This pr does not need any document label May 7, 2022
…espace

### Motivation

Currently in KoP tests, the metadata namespace configured by
`kafkaMetadataNamespace` is "default", which is same with the default
namespace of Pulsar and KoP (`kafkaNamespace`).

https://github.com/streamnative/kop/blob/64001937c92d80ed4f652becd8d6b9768918b875/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KopProtocolHandlerTestBase.java#L176-L177

It's a terrible config because some topic policies might be changed with
the metadata namespace and the offset topic is created during starting.
We should avoid the namespace for normal topics being affected by these
implicit operations.

### Modifications

Remove the configs for `kafkaMetadataTenant` and
`kafkaMetadataNamespace`, then fix the following tests:

- `MultiLedgerTest`: set the infinite retention to avoid rollover
  ledgers being removed automatically.
- `KafkaTopicConsumerManagerTest`: trigger the topic lookup before
  creating `PersistentTopic` objects in `BrokerService` so that broker
  can acquire the ownership of namespace bundles.
- `CacheInvalidatorTest`: unload the metadata namespace instead of the
  default namespace.
@BewareMyPower BewareMyPower force-pushed the bewaremypower/separate-metadata-ns branch from 65ba3a1 to b52a489 Compare May 7, 2022 09:12
@BewareMyPower BewareMyPower marked this pull request as ready for review May 7, 2022 09:12
@BewareMyPower BewareMyPower changed the title [Tests] Separate regular namespace with metadata namespace [Tests] Configure a different metadata namespace with the default namespace May 7, 2022
@BewareMyPower BewareMyPower merged commit 9e402f8 into streamnative:master May 7, 2022
@BewareMyPower BewareMyPower deleted the bewaremypower/separate-metadata-ns branch May 7, 2022 13:51
BewareMyPower added a commit that referenced this pull request May 7, 2022
…espace (#1274)

### Motivation

Currently in KoP tests, the metadata namespace configured by
`kafkaMetadataNamespace` is "default", which is same with the default
namespace of Pulsar and KoP (`kafkaNamespace`).

https://github.com/streamnative/kop/blob/64001937c92d80ed4f652becd8d6b9768918b875/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KopProtocolHandlerTestBase.java#L176-L177

It's a terrible config because some topic policies might be changed with
the metadata namespace and the offset topic is created during starting.
We should avoid the namespace for normal topics being affected by these
implicit operations.

### Modifications

Remove the configs for `kafkaMetadataTenant` and
`kafkaMetadataNamespace`, then fix the following tests:

- `MultiLedgerTest`: set the infinite retention to avoid rollover
  ledgers being removed automatically.
- `KafkaTopicConsumerManagerTest`: trigger the topic lookup before
  creating `PersistentTopic` objects in `BrokerService` so that broker
  can acquire the ownership of namespace bundles.
- `CacheInvalidatorTest`: unload the metadata namespace instead of the
  default namespace.

(cherry picked from commit 9e402f8)
BewareMyPower added a commit that referenced this pull request May 7, 2022
…espace (#1274)

### Motivation

Currently in KoP tests, the metadata namespace configured by
`kafkaMetadataNamespace` is "default", which is same with the default
namespace of Pulsar and KoP (`kafkaNamespace`).

https://github.com/streamnative/kop/blob/64001937c92d80ed4f652becd8d6b9768918b875/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KopProtocolHandlerTestBase.java#L176-L177

It's a terrible config because some topic policies might be changed with
the metadata namespace and the offset topic is created during starting.
We should avoid the namespace for normal topics being affected by these
implicit operations.

### Modifications

Remove the configs for `kafkaMetadataTenant` and
`kafkaMetadataNamespace`, then fix the following tests:

- `MultiLedgerTest`: set the infinite retention to avoid rollover
  ledgers being removed automatically.
- `KafkaTopicConsumerManagerTest`: trigger the topic lookup before
  creating `PersistentTopic` objects in `BrokerService` so that broker
  can acquire the ownership of namespace bundles.
- `CacheInvalidatorTest`: unload the metadata namespace instead of the
  default namespace.

(cherry picked from commit 9e402f8)
BewareMyPower added a commit that referenced this pull request May 7, 2022
…espace (#1274)

### Motivation

Currently in KoP tests, the metadata namespace configured by
`kafkaMetadataNamespace` is "default", which is same with the default
namespace of Pulsar and KoP (`kafkaNamespace`).

https://github.com/streamnative/kop/blob/64001937c92d80ed4f652becd8d6b9768918b875/tests/src/test/java/io/streamnative/pulsar/handlers/kop/KopProtocolHandlerTestBase.java#L176-L177

It's a terrible config because some topic policies might be changed with
the metadata namespace and the offset topic is created during starting.
We should avoid the namespace for normal topics being affected by these
implicit operations.

### Modifications

Remove the configs for `kafkaMetadataTenant` and
`kafkaMetadataNamespace`, then fix the following tests:

- `MultiLedgerTest`: set the infinite retention to avoid rollover
  ledgers being removed automatically.
- `KafkaTopicConsumerManagerTest`: trigger the topic lookup before
  creating `PersistentTopic` objects in `BrokerService` so that broker
  can acquire the ownership of namespace bundles.
- `CacheInvalidatorTest`: unload the metadata namespace instead of the
  default namespace.

(cherry picked from commit 9e402f8)

Resolve the conflicts by printing the KOP_ADDRESS_CACHE, which was
removed in branch-2.9.x and higher since
#864.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants