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
com.alibaba.nacos.naming.controllers.ServiceController#list will out of order when serviceMap's value extent size #4066
Comments
may be can use ConcurrentSkipListMap |
ConcurrentSkipListMap is not suit this case, the order should followed the order that it be added. the LinkedhashMap wrapped by SynchronizedMap is the choice, the degree of concurrency will not be high. |
Just make sure have a fixed order.
发自我的iPhone
在 2020年10月27日,00:44,赵延 <notifications@github.com> 写道:
ConcurrentSkipListMap is not suit this case, the order should followed the order that it be added. the LinkedhashMap wrapped by SynchronizedMap is the choice
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4066 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFS35NFFA5YIMZ2POX4PKDDSMWRQNANCNFSM4S7F4QYA>.
|
No, It's not enough. should follow the order that it be added, because we don't know the next service's position. |
If the service order followed it's order that it be added, user can feel the new servicesName just by add pageNo. |
Key can be a pair of objects, not necessarily a ServiceName, and what is the specific use difference between sorting and sorting with a fixed sort by the time of joining?
发自我的iPhone
在 2020年10月27日,14:46,赵延 <notifications@github.com> 写道:
Just make sure have a fixed order.
No, It's not enough. should follow the order that it be added, because we don't know the next service's position.
If add service as ["10","9","8","7","6","5","4","3","2","1","11","12"], the order should as ["10","9","8","7","6","5","4","3","2","1","11","12"], not ["1", "10", "11", "12", "2", "3", "4", "5", "6", "7", "8", "9"]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4066 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFS35NFIRXXW4YNYXH4YT5TSMZUERANCNFSM4S7F4QYA>.
|
Sorting rules are diverse, and you can choose the simplest sort as the basic sort, and other functions can be implemented on the basis of the other functions.
发自我的iPhone
在 2020年10月27日,17:58,赵延 <notifications@github.com> 写道:
If the service order followed it's order that it be added, user can feel the new servicesName just by add pageNo.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub<#4066 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFS35NG2GNRL376ITMGFFWDSM2KS3ANCNFSM4S7F4QYA>.
|
because the api searched by page, we suppose the page size is 10. Now server has service such as |
yes, we also can use the timestamp that service be added to realize it. |
I think CurrentSkipListMap and custom comparator are fine.
发自我的iPhone
在 2020年10月27日,21:18,赵延 <notifications@github.com> 写道:
Sorting rules are diverse, and you can choose the simplest sort as the basic sort, and other functions can be implemented on the basis of the other functions.
yes, we also can use the timestamp that service be added to realize it.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub<#4066 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFS35NGBSHFG34K6G6YRJGDSM3CDDANCNFSM4S7F4QYA>.
|
that's fine, next morning to solve it |
Is your feature request related to a problem? Please describe.
From the openApi: curl -X GET '127.0.0.1:8848/nacos/v1/ns/service/list?pageNo=1&pageSize=2'.
It can search service list, but when the serviceMap's value map extent size, the serviceMap's value map will out of order.
the request to server, same pageNo and pageSize, the result is different.
The text was updated successfully, but these errors were encountered: