0z5a opened a new pull request, #3818:
URL: https://github.com/apache/dubbo-go/pull/3818

   ### Description
   Fixes #3817
   
   `GetWeightAt` in `cluster/loadbalance/util.go` computes the warmup weight 
from `remote.timestamp`. `URL.MergeURL` only wrote that key when the provider 
URL had no `timestamp`, and then it wrote an empty string. Provider URLs from 
interface-level registries carry `timestamp`, so `remote.timestamp` was never 
set, uptime was always 0, and newly exported providers got full weight 
immediately. The condition was inverted in #2022; before that, the provider 
timestamp was copied to `remote.timestamp`.
   
   With this change, `MergeURL` writes the provider's `timestamp` to 
`remote.timestamp` when the provider URL has one. The merged `timestamp` keeps 
the provider's value, because the closing-tombstone check in 
`registry/directory` uses it to tell a real restart from a stale snapshot. For 
URLs without a `timestamp` (direct connections) the weight is unchanged; the 
only difference is that an empty `remote.timestamp` is no longer added.
   
   The new test `TestMergeURLKeepsProviderTimestampAsRemoteTimestamp` in 
`common/url_test.go` checks that both `remote.timestamp` and `timestamp` carry 
the provider value after a merge. It fails on main and passes with this change. 
`go test ./common/... ./registry/directory/... ./cluster/... ./client/... 
-count=1` passes.
   
   ### Checklist
   - [ ] I confirm the target branch is `develop`
   - [ ] I have run `make fmt` to format my code
   - [ ] I have run `make test` to run local tests
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   
   This change was drafted with Claude Code (claude-opus-5-5); the test results 
above are from the runs described.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to