Commit Graph

1268 Commits

Author SHA1 Message Date
chenhao26
d8238de5e0
[ISSUE#5863] Define InstanceRequest InstanceResponse and Handler (#8489)
* define InstanceRequest InstanceResponse and Handler

* check style
2022-06-01 14:41:08 +08:00
杨翊 SionYang
58968f98e2
[ISSUE#8405] Fix istio module cycle dependency problem. (#8440)
* Get ResourceManager when runtime to resolve cycle dependence temp.

* Fix Ut problem.

* Rollback changes for ClusterControllerTest

* Fix UT problem.
2022-05-23 11:07:02 +08:00
chenhao26
74c3355b71
fix spring cycle dependence JwtTokenManager (#8418)
* fix spring cycle dependence  JwtTokenManager

* remove unuse code

* check code style

* update test metrhod

* remove unuse code

* remove NacosAuthConfig logic from jwttoken

* fix testUpgradeCheckSucc test
2022-05-23 09:53:08 +08:00
杨翊 SionYang
646ea61cab
Remove mina dependency. (#8369) 2022-05-16 10:14:58 +08:00
yanhom
d89076b3e6
Support for ibm J9 (#8325)
* support for ibm J9

* format code, add newline at end of file

* format code

* use nacos code style format codes
2022-05-13 11:03:01 +08:00
杨翊 SionYang
399802603a
Enhance Unit test stability. (#8346)
* Enhance Unit test stability.

* print detail stacktrace when unit test error.
2022-05-11 18:00:27 +08:00
杨翊 SionYang
a1c7715e16
[ISSUE#4982] Fix naming module unit test and generate jacoco coverage report (#8282)
* 更新jacoco版本

* Fix naming module unit test and generate jacoco coverage.

* Fix log too long problem.

* Fix MetricsMonitorTest
2022-05-09 16:08:59 +08:00
Roger3581321
bda6ecad66
[Optimize] Replace keySet() to entrySet() (#8286)
Optimized translateParameterMap() by replacing keySet() to entrySet()
2022-04-30 21:24:30 +08:00
ChunHuiQiu
896bddd043
[ISSUE #8193] Remove redundant code (#8200)
* remove redundant code

* fix constructor
2022-04-27 13:50:48 +08:00
onewe
2ee5122244
[ISSUE #8208] fix ip validate (#8210)
Close #8208
2022-04-22 15:51:40 +08:00
胡俊
cf2b69a28d
Merge pull request #8223 from Chaos-coder/issues#8222_fix
add service null check
2022-04-21 18:39:05 +08:00
chaos
a8f440b714 ClientOperationService result.getExtendDatum multiple calls 2022-04-21 16:07:56 +08:00
chaos
4da60533fa add service null check 2022-04-21 10:02:20 +08:00
Oliver
a9e2cbd4d8
Set interrupted flag to caller (#8116) 2022-04-20 10:49:00 +08:00
onewe
8401b8c836
[ISSUE #8196] Return count number of subscribers correctly when throw an exception (#8197)
Close #8196
2022-04-18 17:10:50 +08:00
liqipeng
f0104c0ea0
[ISSUE #8144] add volatile modifier to ServerListManager.serversFromEndpoint(2.x) (#8146)
* add volatile modifier to `ServerListManager.serversFromEndpoint`

* optimize `onReceiveChecksums` in race condition

* judge responsible server in same localAddress; add `volatile` modifier for `EnvUtil.localAddress`
2022-04-18 11:33:08 +08:00
chenhao26
8e4470c2b8
Call once to get the clientmanager (#8149)
* Call once to get the clientmanager

* clean code
2022-04-18 11:32:04 +08:00
bjxiaojian
814ffb749c
do getServiceString() only once when debug (#8121) 2022-04-12 10:11:01 +08:00
onewe
eac5fe5cd4
[ISSUE #8108] Add NoneHealthCheckProcessorV2 class (#8110)
* [ISSUE #8108] Add NoneHealthCheckProcessorV2 class

Close #8108

* Update NoneHealthCheckProcessor.java
2022-04-11 10:21:46 +08:00
onewe
8292d9e16c
[ISSUE #7999] Fix config that can't read environment args (#8055)
- add unit test
- resetConfig method move to subclass's constructor
2022-04-07 10:20:13 +08:00
chenhao26
5efb233909
add junit test from InstanceControllerV2Test (#8056) 2022-04-06 10:51:24 +08:00
lmw
c51b405565 [#8035] Missing serialVersionUID when class implements Serializable interface 2022-03-30 20:34:28 +08:00
胡俊
0161797e01
Merge pull request #8014 from KomachiSion/develop-issue#8009
[ISSUE#8009] Fix NPE of unit test.
2022-03-28 14:17:31 +08:00
杨翊 SionYang
26ef77378c
For #7930. Default close support upgrade from 1.X feature. (#8016)
* For #7930. Default close support upgrade from 1.X feature(double write and old raft).

* Fix use still use old raft when close upgrade feature.

* UpgradeJudgement subscribe member change event only open upgrade feature.
2022-03-28 14:15:18 +08:00
KomachiSion
d91ac9e2ea Fix #8009. 2022-03-28 10:34:24 +08:00
MajorHe1
5665cfe072
[ISSUE #7966] modify returned msg in Auth/Distro/Curcuit-Filter when internal server error (#7967)
* [ISSUE #7966] modify returned msg in Auth/Distro/Curcuit-Filter when internal server error

* [ISSUE #7966] add log output instead of return stacktrace
2022-03-28 10:22:55 +08:00
spark.ye
71440a99d4
[ISSUE #7971] fix ClusterVersionJudgement#ClusterVersionJudge Task never stop (#7972)
* fix bug(#7971) ClusterVersionJudgement ClusterVersionJudge Task never stop

* fix bug(#7971) change code style
2022-03-28 10:21:50 +08:00
Oliver
5a8c088a2f
remove unused variety and define constant (#8010)
* remove unused variety and define constant

* fix spelling error
2022-03-28 10:18:56 +08:00
Oliver
83aafb7e65
fix comment grammar (#8011)
* optimize method comment grammar

* format method comment

* fix spelling error
2022-03-28 10:18:13 +08:00
chenhao26
b4cc3fcddb
Optimize HTTP constants (#7998)
* Optimize HTTP constants

* check nacos style

* check nacos style2

* check nacos style3

* deleet Unused constants in UtilAndComs
2022-03-25 16:05:42 +08:00
胡俊
2e07c6a0c1
Package scan (#7917)
* PayloadRegistry update use spi

* PayloadRegistry update use spi

* PayloadRegistry update use spi

* PayloadRegistry update use spi

* add test

* update comment

* remove code
rename code
2022-03-11 15:50:44 +08:00
zrlw
bc40318c66
[develop] set default connection lease request timeout and merge default config (#7906)
* set default connection lease request timeout and merge default config

* remove useless code

* correct comments of mergeDefaultConfig
2022-03-09 16:03:27 +08:00
chenhao26
4ceafbeb59
add junit for InstanceUtilTest and ServiceUtilTest (#7909) 2022-03-08 20:16:44 +08:00
胡俊
5d03898049
add DistroClientComponentRegistryTest (#7855) 2022-03-03 13:51:41 +08:00
chenhao26
74e421925b
InstanceUtil 分支判断优化 (#7713) 2022-02-09 15:43:13 +08:00
KomachiSion
232c667feb Remove NamingResourceParser.java 2022-01-21 16:44:44 +08:00
KomachiSion
89cc6caade Add plugin and auth-plugin module, and move class into module. 2022-01-21 15:06:09 +08:00
KomachiSion
79e7a95e62 Add SignType 2022-01-17 17:15:42 +08:00
KomachiSion
dc1c05d2dc Repackage some auth classes. 2022-01-17 16:32:23 +08:00
KomachiSion
956df153d6 Add resource parser 2022-01-14 16:52:21 +08:00
KomachiSion
4e98013f8e Solve conflicts. 2022-01-12 17:02:20 +08:00
KomachiSion
78de31dbdd Merge remote-tracking branch 'upstream/develop' into issue#5696-merge-develop
# Conflicts:
#	auth/src/main/java/com/alibaba/nacos/auth/common/AuthConfigs.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java
#	client/src/main/java/com/alibaba/nacos/client/naming/remote/AbstractNamingClientProxy.java
#	client/src/main/java/com/alibaba/nacos/client/naming/remote/NamingClientProxyDelegate.java
#	client/src/test/java/com/alibaba/nacos/client/naming/remote/AbstractNamingClientProxyTest.java
2022-01-12 16:52:14 +08:00
Catcher Wong
fdab51d663
[ISSUE # #7502] Fix ServiceList count (#7503) 2022-01-12 11:53:26 +08:00
胡俊
cdd83e2117
optimize NotifySubscriberRequest (#7545) 2022-01-07 18:08:22 +08:00
胡俊
fb43badea1
[ISSUE#7208] add InstanceControllerV2 (#7543)
* add InstanceControllerV2

* add InstanceControllerV2
2022-01-07 17:58:09 +08:00
杨翊 SionYang
8b88eaa69f
Add ephmeral attribute in v2 service query api. (#7262) 2021-11-19 11:38:48 +08:00
杨翊 SionYang
7ba2b7c566
[ISSUE#6846] Make one service keep one kind of instance (ephemeral or persistent). (#7239)
* Make one service keep one kind of instance (ephemeral or persistent).

* Fix IT error
2021-11-16 14:06:50 +08:00
杨翊 SionYang
0719200c38
[ISSUE#7210] Add service rest api for v2. (#7211)
* Add service rest api for v2.

* For PMD.
2021-11-11 10:14:14 +08:00
杨翊 SionYang
76aeb180d2
Refactor Server ability init login with SPI. (#7174)
* Move ability classes.

* Add ServerAbilityInitializer and RemoteAbilityInitializer

* Add NamingAbilityInitializer.

* Use ServerAbilityInitializer replace old init ability.

* For pmd.
2021-11-04 10:10:11 +08:00
onewe
ef5bb0a83d
[ISSUE #7114] Enhance the constants for auth module. (#7170)
- Create a Constants.java
- Move all the string literal to the Constants.java
- Delete the PropertiesConstant.java
2021-11-04 09:57:17 +08:00
Roger3581321
ea2a106160
Changed the "initialCapacity" of HashMap (#7074) 2021-10-21 11:39:42 +08:00
brotherlu-xcq
9cf5dcb8f4
[ISSUE #7001] keep the count value in Nacos 2.x same with value Nacos 1.x . (#7064) 2021-10-18 11:17:30 +08:00
Roger3581321
6b568119c2
add final to modify the utility class (#6951) 2021-09-22 09:42:47 +08:00
brotherlu-xcq
dd388e4d05
[ISSUE #6894] add the unit test of com.alibaba.nacos.naming.remote.rpc.handler. (#6916) 2021-09-22 09:40:01 +08:00
brotherlu-xcq
90567c7da4
[ISSUE #6894] add the unit test of com.alibaba.nacos.naming.remote.udp. (#6895) 2021-09-17 19:30:20 +08:00
brotherlu-xcq
11cdba81b3
[ISSUE #6894] add the unit test of com.alibaba.nacos.naming.remote.rpc.filter. (#6905) 2021-09-17 19:28:46 +08:00
brotherlu-xcq
6df0f22244
[ISSUE #6430] [TASK 3] Integrate this workflow to Nacos 2.0, integrate the new Selector logic into 2.x. (#6720)
* [ISSUE #6301] [TASK 3] integrate Selector into Nacos 2.x.

* new compute logic in 2.x

* [ISSUE #6301] the compute logic.

* [ISSUE #6430] remove the unused code and remove the cache logic in Udp push task.
2021-09-09 09:17:06 +08:00
brotherlu-xcq
9658d23b07
[ISSUE #6767] optimize the push data logic. (#6773)
* [ISSUE #6767] optimize the push logic.

* [ISSUE #6767] move the service to PushDataWrapper.

* [ISSUE #6767] optimize the ServiceMetadata.

* [ISSUE #6767] format the javadoc.

* [ISSUE #6767] format the javadoc.

* [ISSUE #6767] fix ci issue.

* [ISSUE #6767] fix ci issue.

* [ISSUE #6767] fix ci issue.
2021-09-02 14:54:17 +08:00
brotherlu-xcq
fa0ef3df53
[ISSUE #6783] Add unit tests for package com.alibaba.nacos.naming.core.v2.upgrade. (#6785)
* [ISSUE #6793] add UpgradeStatesTest.

* [ISSUE #6793] add DoubleWriteEventListenerTest.
2021-09-02 10:48:10 +08:00
brotherlu-xcq
5889b3a5de
[ISSUE #6703] when delete an nonexistent, return services not exist error. (#6704) 2021-08-20 09:37:20 +08:00
brotherlu-xcq
ba6e161353
[ISSUE #6301] [TASK 2] change the UI and startup shell to support custom selector config. (#6691) 2021-08-20 09:32:31 +08:00
brotherlu-xcq
9670627724
[FOR #6301] [TASK 1] Integrate this workflow to Nacos 2.0, replace the Selector in 1.x. (#6680)
* [ISSUE #6301] replace the Selector in 1.x.

* [ISSUE #6301] remove the annotation of API(get all selector types).
2021-08-18 10:00:54 +08:00
brotherlu-xcq
27b0a0cd8a
[ISSUE #6643] Add unit tests for package com.alibaba.nacos.naming.core.v2.service. (#6644) 2021-08-13 09:47:00 +08:00
brotherlu-xcq
025bee74c9
[ISSUE #6535] throw the NacosException in 2.x to keep same with 1.x when Service doesn't exist. (#6597)
* [ISSUE #6535] throw the service not find exception in Nacos 2.x when service no exist.

* [ISSUE #6535] remove the unnecessary variable.
2021-08-10 09:41:17 +08:00
MajorHe1
0b15090bab
[ISSUE #6572] add client info for OperatorController metrics interface (#6576)
* [ISSUE #6572] add client info for OperatorController metrics interface

* [ISSUE #6572] move PERSISTENT_SUFFIX to ClientConstants
2021-08-09 09:52:32 +08:00
MajorHe1
765646db43
[ISSUE #6581] fix json deserialization error of ServiceController subscribers interface (#6582) 2021-08-06 09:46:08 +08:00
ZZQ的
ea864c8c5a
Remove pom dependency (#6561) 2021-08-05 09:35:49 +08:00
brotherlu-xcq
787e161fa9
[ISSUE #6543] Add unit tests for package com.alibaba.nacos.naming.core.*. (#6547)
* [ISSUE #6543] add the unit test of CatalogServiceV2Impl.

* [ISSUE #6543] add unit test of InstanceOperatorClientImpl, HealthOperatorV1ImplTest, HealthOperatorV2ImplTest.

* [ISSUE #6543] add unit test of ServiceOperatorV2Impl.
2021-08-04 09:53:21 +08:00
Roger3581321
2ff8da4832
add final to modify the utility class (#6511) 2021-08-02 09:42:13 +08:00
ZZQ的
a729001ec5
[Reduce dependence]>[Sets] Replace "google.common.collect.*" API with… (#6445)
* [Reduce dependence]>[Sets] Replace "google.common.collect.*" API with jdk API

* delete empty line separator
2021-07-30 16:32:38 +08:00
ZZQ的
9beaacbc54
[Reduce dependence]>[Maps] Replace "google.common.collect.*" API with jdk API (#6443) 2021-07-29 10:46:22 +08:00
杨翊 SionYang
7f567d19c9
remove unused class (#6475) 2021-07-27 19:18:41 +08:00
ZZQ的
47c6706a63
[Reduce dependence]>[Lists] Replace "google.common.collect.*" API wit… (#6404)
* [Reduce dependence]>[Lists] Replace "google.common.collect.*" API with jdk API

* use elements.size to init the array length

* Replace IllegalArgumentException with NullPointerException

* Refactor CollectionUtilsTest#list()

* Add exception message

* update annotation

* update unit test method name
2021-07-27 13:47:41 +08:00
杨翊 SionYang
a5cc7178fc
[ISSUE#6403] the expired time of naming client can be configured. (#6422)
* add AbstractDynamicConfig

* Add ClientConfig

* use ClientConfig to remove expired client.

* For checkstyle

* Update application.properties
2021-07-23 14:03:46 +08:00
brotherlu-xcq
8077ce02a4
[ISSUE #5520] Add unit tests for package com.alibaba.nacos.naming.core.v2.cleaner in nacos2.0. (#6401)
* [ISSUE #5520] add unit test for EmptyServiceAutoCleaner.

* [ISSUE #5520] add unit test for EmptyServiceAutoCleanerV2.
2021-07-22 10:15:21 +08:00
brotherlu-xcq
a64f5b592b
[ISSUE #5519] Add unit tests to package com.alibaba.nacos.naming.controllers in nacos 2.0. (#6414)
* [ISSUE #5519] complete CatalogControllerTest.

* [ISSUE #5519] add unit test in controllers, not include deprecated method.

* [ISSUE #5519] fix ci issue.
2021-07-22 09:58:12 +08:00
brotherlu-xcq
784cc82d9e
[ISSUE #6365] Implement the built-in Selector in Nacos 1.x and add unit test. (#6383)
* [ISSUE #6301] implement the CmdbSelectorContextBuilder and move the 1.x LabelSelector logic to CmdbLabelSelector and add unit test.

* [ISSUE #6301] remove the unused method.

* [ISSUE #6301] fix ci issue.
2021-07-20 10:33:58 +08:00
Pixy Yuan
22393e4456
[ISSUE #6386] Stop v1 distro verification when cluster upgraded to v2. (#6387) 2021-07-19 16:42:34 +08:00
brotherlu-xcq
bb987d05f5
[ISSUE #6356] Define the Selector workflow and add unit test. (#6357)
* [ISSUE #6301] Define the workflow of Selector.

* [ISSUE #6301] Add unit test for SelectorManager.

* [ISSUE #6301] fix ci issue.

* [ISSUE #6301] test Selector with serial.

* [ISSUE #6301] fix javadoc.
2021-07-16 11:31:33 +08:00
杨翊 SionYang
44a1d02922
Fix instance metadata will not be removed for ip port client. (#6332) 2021-07-12 14:32:15 +08:00
hunjipo
cdc276e829
To slightly improve performance, this commit switches to StringBuilder.append(char) instead of StringBuilder.append(String) whenever we append a single character to a StringBuilder. (#6300) 2021-07-12 13:51:14 +08:00
孙继峰
f326a0c543
[ISSUE #5095] Add unit test for ClassUtils (#6327)
* fix typo

* add unit test for ClassUtils
2021-07-12 09:45:35 +08:00
ZZQ的
98e1e72ed9
[issue #6284][naming module] replace *commons.lang3*.*Utils to com.al… (#6291)
* [issue #6284][naming module] replace *commons.lang3*.*Utils to com.alibaba.nacos.common.utils.*Utils

* add StringUtils.split() function

* Replace NumberUtils.isNumber()  -> NumberUtils.isDigits()
2021-07-12 09:16:57 +08:00
杨翊 SionYang
5e545c8d37
[ISSUE#6272] Refactor Instance builder to build and handler request from http. (#6298)
* Add InstanceBuilder and IdGenerator

* Add new builder for http request and client beat

* Use new builder to build api instance.

* Modified according review comment.
2021-07-07 17:01:40 +08:00
shalk(xiao kun)
c973566db9
[ISSUE #6188]add ut for com.alibaba.nacos.naming.cluster (#6279)
* add ut for  com.alibaba.nacos.naming.cluster

* fix ut
2021-07-07 10:02:01 +08:00
杨翊 SionYang
5c375afe81
Add SPI for ClientBeatExtensionHandler (#6250) 2021-07-02 17:17:24 +08:00
孙继峰
f36556657f
[ISSUE #6197] Use java.util.Objects instead of com.alibaba.nacos.common.utils.Objects (#6218) 2021-07-01 11:32:34 +08:00
杨翊 SionYang
eb2644fd37
Add SPI for upgrade checker. (#6217)
* Add SPI for upgrade checker.

* For checkstyle
2021-07-01 11:20:41 +08:00
赵延
3fd77bc7e0
If the client already disconnect, ignore this request to avoid NPE. (#6175)
* if the client already disconnect, ignore this request to avoid npe.

* unify code with DistroClientDataProcessor.

* print warn info when client already disconnect.

* transfer client check logic to method.

* if client is not ephemeral, is illegal.
2021-06-30 10:15:06 +08:00
杨翊 SionYang
f2676bc6ca
[ISSUE#6129] Add ServerConfigChangeEvent when config file changed. (#6130)
* Add ServerConfigChangeEvent when config file changed.

* Upgrade config after notify ServerConfigChangeEvent
2021-06-22 14:39:37 +08:00
Pixy Yuan
ea803a85ae
[ISSUE #6109] Using configuration to register upgrade helpers as conditional beans. (#6115) 2021-06-22 14:07:57 +08:00
杨翊 SionYang
4a474ce30a
For #6116. Refactor ClientManager and make register client and schedule checkTask is atomic. (#6118) 2021-06-22 09:49:59 +08:00
杨翊 SionYang
463a29f082
Develop fix ci (#6092)
* Fix github CI

* Add github IT
2021-06-17 15:15:54 +08:00
zhox
1b18f2c3ca
[code quality][nacos-address]improve the code of ServiceManager.java (#5919)
* [code quality][nacos-address]improve the code of ServiceManager.java

* remove unused import

* 1 fix with ServiceManager.java

* 1 fix with ServiceManager.java
2021-06-16 10:24:36 +08:00
杨翊 SionYang
6ca9c25a68
Fix Unit test in nacos naming module (#6031) 2021-06-15 14:00:17 +08:00
李晓双 Li Xiao Shuang
43f4d5d927
improve the code quality for naming (#6008) 2021-06-09 10:05:23 +08:00
Cherish 蔡
c025dc2c18
Feat resource parser group (#5889)
* feat(#5888): ResourceParser groupName change the splicing method.

* feat(#5888): add UT for NamingResourceParser and ConfigResourceParser
2021-06-09 09:48:18 +08:00
杨翊 SionYang
ae39b9502a
[ISSUE#5921] Adapt some Naming API after upgrading to v2.x. (#5972)
* Fix #5921, Adapt some Naming API after upgrading to v2.x.

* Fix pmd
2021-06-07 16:37:01 +08:00
李晓双 Li Xiao Shuang
90cb967763
improve the code quality for naming misc (#5944) 2021-06-07 14:30:24 +08:00
杨翊 SionYang
1d5a6605ee
[ISSUE#5918] Refactor event publisher in naming module to fix event without orders. (#5930)
* Rollback #5778.

* Add method to register custom sharded event publisher

* Make naming module event use custom sharded publisher
2021-06-03 12:53:29 +08:00
李晓双 Li Xiao Shuang
7a7f267ee9
improve the code quality for naming healthcheck (#5932) 2021-06-03 11:31:39 +08:00
李晓双 Li Xiao Shuang
e199a5ee64
[ISSUE #5774] improve the code quality for naming core (#5914)
* mprove the code quality for naming core

* fix build
2021-06-03 09:59:52 +08:00
Pixy Yuan
07f38a4763
[ISSUE #5927] Init health check status when loading snapshot of persistent instances. (#5928) 2021-06-03 09:35:01 +08:00
杨翊 SionYang
09c7293085
Stop do sync when sync is no need. (#5882) 2021-05-28 14:08:25 +08:00
孙继峰
15c71831e7
[ISSUE #5765] fix localhost not match ip (#5852)
* rename IPUitl to InternetAddressUtil

* move isDomain to InternetAddressUtil

* [ISSUE #5765] fix localhost not match ip

* fix typo

* delete the verification IP, follow the single responsibility principle
2021-05-27 19:01:39 +08:00
tianqingzhao
3b3de662c5
Optimize code that all checks for empty service. (#5869)
* Optimize code that all checks for empty service.

* Add Agreement License.
2021-05-27 18:10:55 +08:00
Pixy Yuan
ebd6322e7e
[ISSUE #5872] Downgrade checker only focus on changing members. (#5873) 2021-05-27 17:44:30 +08:00
Pixy Yuan
34ed52192a
[ISSUE #5870] Prevent instance ephemeral value used by DoubleWrite. (#5871)
* Fix client beat task skip interceptors unexpectedly

* Refactor transform instance and service/cluster between v1/v2 model.

* [ISSUE #5870] Prevent instance ephemeral value used by DoubleWrite.
2021-05-27 17:41:38 +08:00
tianqingzhao
a233563e82
Optimize code that checks for empty service. (#5840) 2021-05-26 10:07:19 +08:00
tianqingzhao
5e40b78500
Remove any extra curly brace suffixes from the log (#5810) 2021-05-24 14:03:05 +08:00
Pixy Yuan
5c7730737a
[ISSUE #5798] Fix upgraded server cannot downgrade and upgrade again. (#5800)
* [ISSUE #5798] Fix upgraded server cannot downgrade and upgrade again.

* Fix NPE when delete ServiceMetadata of an non-exist service.
2021-05-21 11:06:49 +08:00
Pixy Yuan
93fd771271
[ISSUE #5782] Fix removal of instances when DoubleWrite removing service. (#5793) 2021-05-20 11:12:03 +08:00
Pixy Yuan
c858139329
[ISSUE #5775] Persist the cluster upgrade states to disk. (#5792) 2021-05-20 11:11:07 +08:00
李晓双 Li Xiao Shuang
35c8035861
[ISSUE #5774] improve the code quality for controllers (#5784)
* improve the code quality for controllers

* improve the code quality for controllers
2021-05-20 11:05:54 +08:00
李晓双 Li Xiao Shuang
022fb6ac68
improve the code quality for consistency (#5783) 2021-05-20 11:04:56 +08:00
李晓双 Li Xiao Shuang
08db47ce84
magic number (#5781) 2021-05-20 09:51:52 +08:00
FlyingLambrog
5e80d12932
Add unit tests for class naming.core.ClusterOperatorV2Impl (#5763) 2021-05-18 19:52:47 +08:00
Pixy Yuan
4655dded44
[ISSUE #5767] Cleanup data of v1 after disable DoubleWrite. (#5772) 2021-05-18 19:48:07 +08:00
Pixy Yuan
160ed5b360
[ISSUE #5756] Support to specify ephemeral value for createService (#5757)
* [ISSUE #5756] Support to specify ephemeral value for `UpgradeOpsController.createService` .

* [ISSUE #5756] Fix PathVariable is not supported by DistroFilter.
2021-05-17 20:19:43 +08:00
haoyann
536da8214c
remove duplicate client expire check (#5751) 2021-05-17 10:10:54 +08:00
FlyingLambrog
5cb3b6db20
Add unit tests for package com.alibaba.nacos.naming.core.v2.cleaner (#5750) 2021-05-17 10:08:54 +08:00
xiaoheng1
2783167bd3
fix #5724 Extract constants in JacksonSerializer (#5725) 2021-05-17 09:48:46 +08:00
Pixy Yuan
2b076faa63
[ISSUE #5718] Add some APIs for upgrade ops. (#5719)
* [ISSUE #5718] Add some APIs for upgrade ops.

* [ISSUE #5718] Optimize textual field output of metrics API.
2021-05-17 09:47:03 +08:00
xiaoheng1
b33134cf50
Extract constants in HealthController (#5717)
* fix #5715 Extract constants in HealthController

* fix #5715 Extract constants in HealthController

* add license
2021-05-17 09:44:23 +08:00
李晓双 Li Xiao Shuang
fdaf1d9cd9
add unit test for SpiImplPushExecutorHolder (#5716) 2021-05-17 09:42:48 +08:00
李晓双 Li Xiao Shuang
2bc782ee9c
add unit test for ServiceChangeEvent (#5714) 2021-05-17 09:42:10 +08:00
李晓双 Li Xiao Shuang
1974cf01b3
fix magic number (#5709) 2021-05-14 14:46:59 +08:00
KomachiSion
cf5a171ac5 Merge remote-tracking branch 'upstream/develop' into feature_support_grpc_core
# Conflicts:
#	NOTICE
#	api/pom.xml
#	common/src/main/java/com/alibaba/nacos/common/notify/DefaultPublisher.java
#	config/src/main/java/com/alibaba/nacos/config/server/service/LongPollingService.java
#	naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperationTest.java
#	naming/src/test/java/com/alibaba/nacos/naming/core/DomainsManagerTest.java
#	naming/src/test/java/com/alibaba/nacos/naming/healthcheck/ClientBeatCheckTaskTest.java
#	pom.xml
#	test/src/test/java/com/alibaba/nacos/test/core/JacksonUtils.java
2021-05-14 11:04:52 +08:00
Pixy Yuan
98aae398f8
[ISSUE #5692] Make service removal sensed by double write. (#5706)
* [ISSUE #5692] Add double write task sensing removal of v2 service.

* [ISSUE #5692] Add double write task sensing removal of v1 service.

* [ISSUE #5692] Make async checker of services sensing removal of v1 service.
2021-05-14 09:54:52 +08:00
mingyang feng
64601e0581
Fixes logical judgment expression #5683 (#5685)
* One aspect of code quality is to have better expressions.

* Update ClientBeatProcessor.java

* Update ClientBeatProcessor.java
2021-05-14 09:39:36 +08:00
杨翊 SionYang
d929c2e328
Add monitor about Distro (#5686) 2021-05-12 16:42:37 +08:00
Pixy Yuan
b6d96b69c7
Fix service group name when upgrading. (#5674)
* [ISSUE #5671] Prefer serviceV2.groupName using groupName in serviceV1.name

* [ISSUE #5671] Add groupName to service when creating by v1 operator
2021-05-11 20:41:18 +08:00
JackSun-Developer
af0f01d21b
[#5600] The class com.alibaba.nacos.naming.core.DistroMapperTest lacks Unit Test. (#5605) 2021-05-10 11:44:41 +08:00
FlyingLambrog
af0c2f5fcb
Add unit test for class naming.consistency.persistent.impl.NamingKvStorage (#5568) 2021-05-10 11:43:51 +08:00
JackSun-Developer
5395237062
[#5581] The class DataStore lacks a lot of Unit Tests. (#5582) 2021-05-10 11:10:56 +08:00
李晓双 Li Xiao Shuang
16e80ec91f
add unit test for v2 index (#5563) 2021-05-10 10:53:15 +08:00
李晓双 Li Xiao Shuang
0541ba8deb
[ISSUE #5522] add unit test for MetadataOperation (#5608)
* add unit test for MetadataOperation

* update method name
2021-05-10 10:47:28 +08:00
李晓双 Li Xiao Shuang
b478166d1c
add unit test for NamingMetadataManager (#5609) 2021-05-10 10:47:09 +08:00
李晓双 Li Xiao Shuang
7f924b58f1
add unit test for NamingMetadataOperateService (#5610) 2021-05-10 10:46:52 +08:00
李晓双 Li Xiao Shuang
8fa60671e9
add unit test for ServiceMetadata (#5611) 2021-05-10 10:46:29 +08:00
李晓双 Li Xiao Shuang
b70549d6e3
add unit test for ServiceMetadataSnapshotOperation (#5613) 2021-05-10 10:46:13 +08:00
李晓双 Li Xiao Shuang
4bc80436da
add unit test for ServiceMetadataProcessor (#5614) 2021-05-10 10:45:06 +08:00
孙继峰
818d37b71c
delete duplicated dependency (#5622) 2021-05-10 10:43:58 +08:00
JackSun-Developer
52278a4849
[#5554] Fix Unit Test for com.alibaba.nacos.naming.core.DomainsManager.java (#5555) 2021-04-30 18:06:29 +08:00
JackSun-Developer
1b1975a2fd
[#5551] Fix Unit Test for com.alibaba.nacos.naming.healthcheck.ClientBeatCheckTask (#5552) 2021-04-30 18:06:12 +08:00
JackSun-Developer
ca7e4cc780
[#5549] Fix Unit test for NamingSnapshotOperationTest.java (#5550) 2021-04-30 18:05:45 +08:00
JackSun-Developer
7d110e665e
[#5545] naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/ClusterVersionJudgementTest.java unit tests cannot pass, and have bad code style. (#5546) 2021-04-30 15:48:50 +08:00
KomachiSion
2847373fd0 Solve conflict 2021-04-27 16:19:56 +08:00
KomachiSion
92da848375 Merge remote-tracking branch 'upstream/develop' into merge-1.X-to-2.0
# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/CacheData.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	client/src/main/java/com/alibaba/nacos/client/naming/core/PushReceiver.java
#	console/src/main/resources/static/css/main.css
#	console/src/main/resources/static/js/main.js
#	naming/src/main/java/com/alibaba/nacos/naming/core/SubscribeManager.java
#	naming/src/test/java/com/alibaba/nacos/naming/core/SubscribeManagerTest.java
#	test/src/test/java/com/alibaba/nacos/test/BaseTest.java
2021-04-27 15:57:24 +08:00
KomachiSion
bd8ac55386 rollback subscribers push data immediately to protect push frequent. 2021-04-27 15:38:26 +08:00
李晓双 Li Xiao Shuang
6c20d35af8
add unit test for PersistentConsistencyServiceDelegateImpl (#5491)
* add unit test for PersistentConsistencyServiceDelegateImpl

* add unit test for PersistentConsistencyServiceDelegateImpl

* add unit test for PersistentConsistencyServiceDelegateImpl
2021-04-27 10:12:02 +08:00
杨翊 SionYang
71a0037f50
Refactor Distro Config as singleton and replace GlobalConfig (#5486)
* Refactor Distro Config as singleton and replace GlobalConfig

* Use configed timeout for distro sync and verify

* Fix IT error.
2021-04-25 16:50:10 +08:00
杨翊 SionYang
267d67190b
Some enhancement for logs and ability. (#5482) 2021-04-25 13:08:24 +08:00
JackSun-Developer
ee8f636db1
[#5467] com.alibaba.nacos.naming.consistency.DelegateConsistencyServiceImpl lacks a lot of Unit Tests. (#5468) 2021-04-23 19:14:37 +08:00
brothelul
6c270cb3ac
[ISSUE #5078] set default pageSize to 10000 for getting all the subscribers in other server node. (#5424)
* hardcode to get all the subscribers by set the pageSize to 10000

* change the default pageSize from 10000 to 1000

* change the param of getSubscriber to support the pageNo and pageSize
2021-04-23 09:52:04 +08:00
Pixy Yuan
758b8b3942
[ISSUE #5442] change state to UP when received status form old version server (#5445)
* [ISSUE #5442] change state to UP when received status form old version server

* [ISSUE #5442] Optimize server status received logic
2021-04-22 16:39:19 +08:00
MajorHe1
0a4f7f5e75
[ISSUE #5361] check isUseGrpcFeatures() when subscribe service using GRPC (#5411)
* [ISSUE #5361] check isUseGrpcFeatures() when subscribe service using GRPC

* [ISSUE #5361] add a GrpcRequestFilter to check isUseGrpcFeatures() when using GRPC protocol

* [ISSUE #5361] add a judgement whether request instance of AbstractNamingRequest

* [ISSUE #5361] reformat code using nacos-code-style-for-idea.xml
2021-04-22 10:12:57 +08:00
杨翊 SionYang
4c1b879d00
For #5419, Fix Nacos 2.0 client auth may invalid for non public namespace. (#5422) 2021-04-20 19:29:59 +08:00
杨翊 SionYang
3a4c8efb14
For #5404, Fix frequently udp push for client 1.X (#5413) 2021-04-20 09:57:14 +08:00
杨翊 SionYang
73eea9c0bb
Use ThreadUtil and EnvUtil replace Runtime.availableProcessor (#5388) 2021-04-16 17:32:14 +08:00
MajorHe1
ec2528f475
[ISSUE #5361] check isUseGrpcFeatures() when register instance using GRPC protocol (#5365)
* [ISSUE #5361] check isUseGrpcFeatures() when register instance using GRPC protocol

* [ISSUE #5361] change hint message when register instance failed using GRPC
2021-04-16 10:34:58 +08:00
JackSun-Developer
02ebe0190e
[#5350] In version 1.4.1, modify the Server is Down prompt to the specific reason for the machine failure and send it to the user (#5360) 2021-04-14 10:02:49 +08:00
KomachiSion
77990982ef Solve Conflict 2021-04-13 14:44:21 +08:00
KomachiSion
51cc2b1b4b Merge remote-tracking branch 'upstream/develop' into feature_support_grpc_core
# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/CacheData.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	client/src/test/java/com/alibaba/nacos/client/config/common/GroupKeyTest.java
#	common/src/test/resources/META-INF/services/com.alibaba.nacos.common.spi.SpiTestInterface
#	config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java
#	console/src/main/resources/static/css/main.css
#	console/src/main/resources/static/js/main.js
#	istio/src/main/java/com/alibaba/nacos/istio/mcp/NacosMcpService.java
#	naming/src/main/java/com/alibaba/nacos/naming/controllers/ApiController.java
#	naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java
#	naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java
2021-04-13 14:28:30 +08:00
杨翊 SionYang
e689c1a3a1
Remove blocked thread for Protocol metadata (#5354) 2021-04-13 14:12:19 +08:00
Jisfeng
d9dff86f7a
fix subscriber app unknown (#5324) 2021-04-12 10:01:19 +08:00
杨翊 SionYang
a50d9678ae
Push support config some parameters (#5307) 2021-04-08 17:25:31 +08:00
Wu Zhiguo
9bcb901174
Fix some typo (#5260)
* fix some typo

* rollback some comment format
2021-04-03 12:57:57 +08:00
杨翊 SionYang
d146e057c4
Fix ThreadPool usage problem and add some monitor for distro (#5237) 2021-03-30 16:27:41 +08:00
杨翊 SionYang
1969f00aa5
Fix #5204, Fix query error when pageNo is larger than service number. (#5228) 2021-03-29 15:31:25 +08:00
李晓双 Li Xiao Shuang
d5b9b908a0
[ISSUE #5096] Add unit tests to package com.alibaba.nacos.naming.healthcheck in nacos 2.0 (#5170)
* add unit test for healthcheck

* add newline

* delete javadoc

* add Licensed

* add verify

* normalize
2021-03-26 10:01:06 +08:00
Pixy Yuan
db49388f62
[ISSUE #5169] Fix instance beat run only by responsible server. (#5179)
* [ISSUE #5169] DISTRO filter support `beat` parameter

For old version clients.

* [ISSUE #5169] Only responsible server need to check instance heartbeats
2021-03-25 09:48:00 +08:00
杨翊 SionYang
fb9300d87f
Nacos2.0 adapt batch instance metadata operate (#5141)
* Rebuild ui

* Nacos2.0 adapt batch instance metadata operate
2021-03-19 11:48:06 +08:00
KomachiSion
6cda5ad55a Merge remote-tracking branch 'upstream/develop' into develop-merge-to-2.0
# Conflicts:
#	client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java
#	client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java
#	client/src/test/java/com/alibaba/nacos/client/config/impl/YmlChangeParserTest.java
#	common/src/main/java/com/alibaba/nacos/common/http/param/Header.java
#	common/src/main/java/com/alibaba/nacos/common/utils/ConcurrentHashSet.java
#	config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java
#	console/src/main/resources/static/js/main.js
#	core/src/main/java/com/alibaba/nacos/core/cluster/ServerMemberManager.java
#	core/src/main/java/com/alibaba/nacos/core/utils/Loggers.java
#	naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java
#	naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HealthCheckReactor.java
#	pom.xml
2021-03-18 12:08:45 +08:00
杨翊 SionYang
f1cf643b81
Try to fix #4573,#4629. Jraft leader status check error. (#5129) 2021-03-18 11:11:45 +08:00
杨翊 SionYang
00032676e9
[ISSUE#4829] Remove instance when distro and raft remove instances data. (#5131)
* Fix #4829, remove instance when distro and raft remove instances data.

* Remove synchronized
2021-03-18 09:53:48 +08:00
haoyann
fd57e08897
perfect KvStorage doc (#5112) 2021-03-16 16:54:17 +08:00
Pixy Yuan
ed1f244e8b
[ISSUE #5109] Fix HealthCheckCommonV2 sometimes will not finish the c… (#5110)
* [ISSUE #5109] Fix HealthCheckCommonV2 sometimes will not finish the checking flag.

* [ISSUE #5109] Add a warning log to a maybe-unreachable code at tcp check processor.
2021-03-16 16:53:30 +08:00
JackSun-Developer
bb9e37491f
[ISSUE #4983] Add unit tests to package com.alibaba.nacos.naming.core.v2.service in nacos 2.0 (#5107) 2021-03-16 09:49:59 +08:00
Pixy Yuan
e6402bc2a8
[ISSUE #5087] Enabled healthy protection threshold when pushing instance data. (#5088) 2021-03-12 17:48:47 +08:00
杨翊 SionYang
8a4b885fd6
Use hook to monitor and report push result. (#5091)
* Add subscribe count monitor.

* Use hook to monitor and report push result.

* Fix ip count monitor will become negative number
2021-03-12 17:48:14 +08:00
Pixy Yuan
8bc49c39fc
[ISSUE #5070] Fix catalog instance listing, make selectInstancesWithHealthyProtection isolated. (#5085) 2021-03-12 14:49:07 +08:00
Pixy Yuan
4acb6957f8
[ISSUE #5080] Fix health checker pre-start logic. (#5081) 2021-03-12 14:47:17 +08:00
haoyann
25a8bf696b
[ISSUE #4936]Enhance the message when NamingKvStorage#get error (#5077)
* Enhance the message when NamingKvStorage#get error

* enhance get and delete operation
2021-03-12 10:51:35 +08:00
Pixy Yuan
85942358ba
[ISSUE #5067] Listing instances and marked as healthy state when heal… (#5069)
* [ISSUE #5067] Listing instances and marked as healthy state when healthy protection threshold reached.

Whatever state the instance is.

* [ISSUE #5067] Fix code formatting.
2021-03-10 16:28:22 +08:00
Pixy Yuan
5c8559b8ba
[ISSUE #5054] Support naming instance list with healthy protection using service.protectionThreshold. (#5055)
* [ISSUE #5054] Support naming instance list with healthy protection using service.protectionThreshold.

* [ISSUE #5054] Fix code formatting.
2021-03-09 11:11:40 +08:00
KomachiSion
cdc7b67292 Fix verify callback build error. 2021-03-08 18:01:10 +08:00
KomachiSion
ff0838268a Fix distro client verify return error code problem. 2021-03-08 17:48:54 +08:00
赵延
b1c39a6354
[ISSUE-#4306] StringJoiner should consider '@@'. (#5022)
* StringJoiner should consider '@@'.

* StringJoiner should consider '@@'.
2021-03-08 11:43:26 +08:00
杨翊 SionYang
eb36581c2c
Refactor and enhance for client distro protocol (#5017)
* Distro check dataStorage status before send verify data.

* Add source server address info for distro verify.

* Refactor Distro verify task.

* Refactor Distro client verify task
2021-03-05 11:45:56 +08:00
KomachiSion
328f905cb3 Fix Unit test error 2021-03-04 19:33:49 +08:00
Pixy Yuan
cab401d5b6
Fix #5001. Returns empty list when service has no subscribers. (#5004) 2021-03-04 18:54:05 +08:00
杨翊 SionYang
121b07be7d
Single push to client when client subscribe service. (#4998) 2021-03-03 17:59:01 +08:00
杨翊 SionYang
5c7c28e191
For #4989, fix throws NPE when some metadata value is null. (#4994) 2021-03-03 15:08:16 +08:00
杨翊 SionYang
99cb98d1cf
For #4987, Fix throw exception when build ClientInfo with empty user-agent. (#4993) 2021-03-03 14:32:28 +08:00
JackSun-Developer
02195ef00b
Add unit tests for package com.alibaba.nacos.naming.core.v2.client.impl (#4978) 2021-03-01 16:41:32 +08:00
赵延
d8dbf540d2
fix one service init twice problem. (#4968) 2021-03-01 10:01:19 +08:00
KomachiSion
e1cbdc490e For checkstyle 2021-02-26 16:45:23 +08:00
JackSun-Developer
69413e3b73
Add unit tests for package com.alibaba.nacos.naming.core.v2.client.manager.impl (#4967) 2021-02-26 16:44:35 +08:00
KomachiSion
158f2b419c Fix serialize error problem 2021-02-26 14:13:43 +08:00