apache / apache/dubbo

[Feature] Enable the ConfigCenter And MetadataCenter to support option of `check=false`

Open
#15,623 1 comment 0 reactions 1 assignee Claimed by @fantiq View on GitHub
component/sdk help wanted type/enhancement
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

### Pre-check

- [x] I am sure that all the content I provide is in English.

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar feature requirement.

### Apache Dubbo Component

Java SDK (apache/dubbo)

### Descriptions

Both the ConfigCenter and the MetadataCenter support option `check`. When the initial connection attempt fails, `true` means interrupt the whole process once it fails, but `false` is not fully supported.

Overall, I believe the following points need to be supported here:
1. When the initial connection attempt fails, the whole process will not interrupted
2. When the connection recovery, some related functions also need to be recovered and supported

## ConfigCenter

- Add `boolean isAvailable()` method to `DynamicConfiguration`, used for fail fast before connection recovery.
- Once the ConfigCenter completes initialization, it will update the config items `ExternalConfig` and `AppExternalConfig`. Do we need to update these config items after the connection is recovered? Some discussions are needed.
- In the process of service export and reference, every service will create a listener for every ConfigCenter. There should recreate listener after the connection is recovered. Also the Router Rule listener need to be recreated.
- A listener is created when the `MigrationRuleListener` is initialized. Recovery also need to be supported here.

## MetadataCenter

- Add `boolean isAvailable()` method to `MetadataReport`, used for fail fast before connection recovery.
- When reporting `ServiceDefinition`, each `MetadataReport` will be traversed for reporting, and there will be failure retries. However, if all reports fail, some logging should be required.
- When reporting `ServiceNameMapping`, it will retry if all `MetadataReport` report fail, but there is a lack of retry for each `MetadataReport`.
- In the `ServiceDiscovery`, it is necessary to support both `MetadataInfo` and `ServiceInstance` reporting retries. Maybe a status for whether it has been reported or not needs to be introduced here.

## Something else

SPI extensions should support the method `boolean isAvailable()`.

### Related issues

This issue is a continuation of #15271 and it is part of PR #15594 .

### Are you willing to submit a pull request to fix on your own?

- [x] Yes I am willing to submit a pull request on my own!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.