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

Conversation

@BewareMyPower
Copy link
Collaborator

Fixes #1272

Motivation

#448 introduced a bug that the
compaction threshold was not set in metadata namespace.

// NOTE: compactionThreshold is always null unless it has been configured
Long compactionThreshold = namespaces.getCompactionThreshold(kafkaMetadataNamespace);
if (compactionThreshold != null && compactionThreshold != MAX_COMPACTION_THRESHOLD) {
    // it never gets here unless compaction threshold has been configured
    namespaces.setCompactionThreshold(kafkaMetadataNamespace, MAX_COMPACTION_THRESHOLD);
}

In addition, currently there is no test that ensures the metadata has
been initialized correctly.

Modifications

  • Configure the compaction threshold when the metadata namespace is
    created. Since the policies could only be configured when the
    namespace didn't exist before, there is no need to check the existing
    policy.
  • Add MetadataInitTest to test the metadata namespace has been
    configured correctly. It also verifies the
    kafkaManageSystemNamespaces config, which disables the
    initialization of the metadata namespace.
  • Refactor the internalSetup method to avoid the redundant start of
    broker.

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 6, 2022 18:37
@BewareMyPower BewareMyPower self-assigned this May 6, 2022
@github-actions github-actions bot added the no-need-doc This pr does not need any document label May 6, 2022
@BewareMyPower BewareMyPower requested a review from wenbingshen May 6, 2022 18:44
@BewareMyPower BewareMyPower marked this pull request as draft May 7, 2022 03:30
@BewareMyPower
Copy link
Collaborator Author

This PR relies on the changes of #1274.

Fixes streamnative#1272

### Motivation

streamnative#448 introduced a bug that the
compaction threshold was not set in metadata namespace.

```java
// NOTE: compactionThreshold is always null unless it has been configured
Long compactionThreshold = namespaces.getCompactionThreshold(kafkaMetadataNamespace);
if (compactionThreshold != null && compactionThreshold != MAX_COMPACTION_THRESHOLD) {
    // it never gets here unless compaction threshold has been configured
    namespaces.setCompactionThreshold(kafkaMetadataNamespace, MAX_COMPACTION_THRESHOLD);
}
```

In addition, currently there is no test that ensures the metadata has
been initialized correctly.

### Modifications

- Configure the compaction threshold when the metadata namespace is
  created. Since the policies could only be configured when the
  namespace didn't exist before, there is no need to check the existing
  policy.
- Add `MetadataInitTest` to test the metadata namespace has been
  configured correctly. It also verifies the
  `kafkaManageSystemNamespaces` config, which disables the
  initialization of the metadata namespace.
- Refactor the `internalSetup` method to avoid the redundant start of
  broker.
@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-metadata-ns-compaction branch from 69ee493 to 52b76dd Compare May 7, 2022 13:53
@BewareMyPower BewareMyPower marked this pull request as ready for review May 7, 2022 13:53
Copy link
Contributor

@wenbingshen wenbingshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Good find! :)

@BewareMyPower BewareMyPower merged commit 82211b9 into streamnative:master May 7, 2022
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-metadata-ns-compaction branch May 7, 2022 16:56
BewareMyPower added a commit that referenced this pull request May 7, 2022
Fixes #1272

### Motivation

#448 introduced a bug that the
compaction threshold was not set in metadata namespace.

```java
// NOTE: compactionThreshold is always null unless it has been configured
Long compactionThreshold = namespaces.getCompactionThreshold(kafkaMetadataNamespace);
if (compactionThreshold != null && compactionThreshold != MAX_COMPACTION_THRESHOLD) {
    // it never gets here unless compaction threshold has been configured
    namespaces.setCompactionThreshold(kafkaMetadataNamespace, MAX_COMPACTION_THRESHOLD);
}
```

In addition, currently there is no test that ensures the metadata has
been initialized correctly.

### Modifications

- Configure the compaction threshold when the metadata namespace is
  created. Since the policies could only be configured when the
  namespace didn't exist before, there is no need to check the existing
  policy.
- Add `MetadataInitTest` to test the metadata namespace has been
  configured correctly. It also verifies the
  `kafkaManageSystemNamespaces` config, which disables the
  initialization of the metadata namespace.
- Refactor the `internalSetup` method to avoid the redundant start of
  broker.

(cherry picked from commit 82211b9)
BewareMyPower added a commit that referenced this pull request May 7, 2022
Fixes #1272

### Motivation

#448 introduced a bug that the
compaction threshold was not set in metadata namespace.

```java
// NOTE: compactionThreshold is always null unless it has been configured
Long compactionThreshold = namespaces.getCompactionThreshold(kafkaMetadataNamespace);
if (compactionThreshold != null && compactionThreshold != MAX_COMPACTION_THRESHOLD) {
    // it never gets here unless compaction threshold has been configured
    namespaces.setCompactionThreshold(kafkaMetadataNamespace, MAX_COMPACTION_THRESHOLD);
}
```

In addition, currently there is no test that ensures the metadata has
been initialized correctly.

### Modifications

- Configure the compaction threshold when the metadata namespace is
  created. Since the policies could only be configured when the
  namespace didn't exist before, there is no need to check the existing
  policy.
- Add `MetadataInitTest` to test the metadata namespace has been
  configured correctly. It also verifies the
  `kafkaManageSystemNamespaces` config, which disables the
  initialization of the metadata namespace.
- Refactor the `internalSetup` method to avoid the redundant start of
  broker.

(cherry picked from commit 82211b9)
BewareMyPower added a commit that referenced this pull request May 7, 2022
Fixes #1272

### Motivation

#448 introduced a bug that the
compaction threshold was not set in metadata namespace.

```java
// NOTE: compactionThreshold is always null unless it has been configured
Long compactionThreshold = namespaces.getCompactionThreshold(kafkaMetadataNamespace);
if (compactionThreshold != null && compactionThreshold != MAX_COMPACTION_THRESHOLD) {
    // it never gets here unless compaction threshold has been configured
    namespaces.setCompactionThreshold(kafkaMetadataNamespace, MAX_COMPACTION_THRESHOLD);
}
```

In addition, currently there is no test that ensures the metadata has
been initialized correctly.

### Modifications

- Configure the compaction threshold when the metadata namespace is
  created. Since the policies could only be configured when the
  namespace didn't exist before, there is no need to check the existing
  policy.
- Add `MetadataInitTest` to test the metadata namespace has been
  configured correctly. It also verifies the
  `kafkaManageSystemNamespaces` config, which disables the
  initialization of the metadata namespace.
- Refactor the `internalSetup` method to avoid the redundant start of
  broker.

(cherry picked from commit 82211b9)
michaeljmarshall pushed a commit to michaeljmarshall/kop that referenced this pull request Dec 13, 2022
…native#1273)

Fixes streamnative#1272

streamnative#448 introduced a bug that the
compaction threshold was not set in metadata namespace.

```java
// NOTE: compactionThreshold is always null unless it has been configured
Long compactionThreshold = namespaces.getCompactionThreshold(kafkaMetadataNamespace);
if (compactionThreshold != null && compactionThreshold != MAX_COMPACTION_THRESHOLD) {
    // it never gets here unless compaction threshold has been configured
    namespaces.setCompactionThreshold(kafkaMetadataNamespace, MAX_COMPACTION_THRESHOLD);
}
```

In addition, currently there is no test that ensures the metadata has
been initialized correctly.

- Configure the compaction threshold when the metadata namespace is
  created. Since the policies could only be configured when the
  namespace didn't exist before, there is no need to check the existing
  policy.
- Add `MetadataInitTest` to test the metadata namespace has been
  configured correctly. It also verifies the
  `kafkaManageSystemNamespaces` config, which disables the
  initialization of the metadata namespace.
- Refactor the `internalSetup` method to avoid the redundant start of
  broker.

(cherry picked from commit 82211b9)
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.

[BUG] Strange write frequency to the offset topic

2 participants