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

[doc][improvement] enable geo-replication at topic level need extra config #16713

Merged
merged 3 commits into from
Jul 23, 2022

Conversation

youzipi
Copy link
Contributor

@youzipi youzipi commented Jul 21, 2022

Motivation

i try to enable the topic level geo-replication in my cluster,
when i execute ./pulsar-admin topics set-replication-clusters public/default/repl-test --clusters standalone,aliyun-test, i got error:

2022-07-19T09:05:09,444+0000 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/persistent/public/default/repl-test/replication] Failed to perform http post request: javax.ws.rs.NotAllowedException: HTTP 405 Topic level policies is disabled, to enable the topic level policy and retry.
Topic level policies is disabled, to enable the topic level policy and retry.

Reason: Topic level policies is disabled, to enable the topic level policy and retry.

after enable the topic error, try again, i got a 500 error:

2022-07-21T03:37:17,796+0000 [AsyncHttpClient-7-1] WARN  org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/persistent/public/default/repl-test/replication] Failed to perform http post request: javax.ws.rs.InternalServerErrorException: HTTP 500 Topic policies service is disabled.

 --- An unexpected error occurred in the server ---

Message: Topic policies service is disabled.

Stacktrace:

java.lang.UnsupportedOperationException: Topic policies service is disabled.
	at org.apache.pulsar.broker.service.TopicPoliciesService$TopicPoliciesServiceDisabled.updateTopicPoliciesAsync(TopicPoliciesService.java:151)
	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalSetReplicationClusters$215(PersistentTopicsBase.java:3119)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
	at org.apache.pulsar.client.util.RetryUtil.lambda$executeWithRetry$2(RetryUtil.java:62)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:883)
	at java.base/java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2251)
	at org.apache.pulsar.client.util.RetryUtil.executeWithRetry(RetryUtil.java:48)
	at org.apache.pulsar.client.util.RetryUtil.lambda$retryAsynchronously$0(RetryUtil.java:42)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)

after search the doc, i could not found any information about the Topic policies service.
then i found these in code:

// org.apache.pulsar.broker.PulsarService#start
            // Start topic level policies service
            if (config.isTopicLevelPoliciesEnabled() && config.isSystemTopicEnabled()) {
                this.topicPoliciesService = new SystemTopicBasedTopicPoliciesService(this);
            }
//     default value:
private TopicPoliciesService topicPoliciesService = TopicPoliciesService.DISABLED;

means i need to configure the systemTopicEnabled too,
the error msg is somewhat confuse.

i also think that we need more information about the topic policy service

Modifications

add necessary tips

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc
    (Your PR contains doc changes)

youzipi added 2 commits July 21, 2022 15:54
…evelPoliciesEnabled` and `systemTopicEnabled`
…evelPoliciesEnabled` and `systemTopicEnabled`
@github-actions github-actions bot added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Jul 21, 2022
@youzipi
Copy link
Contributor Author

youzipi commented Jul 21, 2022

@Anonymitaet

@codelipenghui codelipenghui added this to the 2.11.0 milestone Jul 21, 2022
Copy link
Member

@Anonymitaet Anonymitaet left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

  1. Before submitting a doc PR, please preview your changes locally. When submitting a PR, please attach the screenshots of your local preview. In this way, you can get your PR reviewed and merged more quickly.

  2. Does this change apply to multiple doc versions? If so, please update them all.

Thank you! 😊

…evelPoliciesEnabled` and `systemTopicEnabled`
@youzipi
Copy link
Contributor Author

youzipi commented Jul 22, 2022

this tip should be displayed in all 2.10.x versions doc at least.
as:

  • this configuration is enabled by default after 2.11.0.
  • topic level geo-replication is introduced in 2.10.0.

image
@Anonymitaet

@codelipenghui codelipenghui merged commit 162587b into apache:master Jul 23, 2022
@youzipi youzipi deleted the 202207_doc_geo-replication branch July 23, 2022 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants