aboutsummaryrefslogtreecommitdiff
path: root/weed/server/master_grpc_server.go
AgeCommit message (Collapse)AuthorFilesLines
10 daysfix: weed shell can't connect to master when no volume servers (#7710)Chris Lu1-7/+22
fix: weed shell can't connect to master when no volume servers (#7701) When there are no volume servers registered, the master's KeepConnected handler would not send any initial message to clients. This caused the shell's masterClient to block indefinitely on stream.Recv(), preventing it from setting currentMaster and completing the connection handshake. The fix ensures the master always sends at least one message with leader information to newly connected clients, even when ToVolumeLocations() returns an empty slice.
2025-12-02Support separate volume server ID independent of RPC bind address (#7609)Chris Lu1-2/+2
* pb: add id field to Heartbeat message for stable volume server identification This adds an 'id' field to the Heartbeat protobuf message that allows volume servers to identify themselves independently of their IP:port address. Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * storage: add Id field to Store struct Add Id field to Store struct and include it in CollectHeartbeat(). The Id field provides a stable volume server identity independent of IP:port. Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * topology: support id-based DataNode identification Update GetOrCreateDataNode to accept an id parameter for stable node identification. When id is provided, the DataNode can maintain its identity even when its IP address changes (e.g., in Kubernetes pod reschedules). For backward compatibility: - If id is provided, use it as the node ID - If id is empty, fall back to ip:port Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * volume: add -id flag for stable volume server identity Add -id command line flag to volume server that allows specifying a stable identifier independent of the IP address. This is useful for Kubernetes deployments with hostPath volumes where pods can be rescheduled to different nodes while the persisted data remains on the original node. Usage: weed volume -id=node-1 -ip=10.0.0.1 ... If -id is not specified, it defaults to ip:port for backward compatibility. Fixes https://github.com/seaweedfs/seaweedfs/issues/7487 * server: add -volume.id flag to weed server command Support the -volume.id flag in the all-in-one 'weed server' command, consistent with the standalone 'weed volume' command. Usage: weed server -volume.id=node-1 ... Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * topology: add test for id-based DataNode identification Test the key scenarios: 1. Create DataNode with explicit id 2. Same id with different IP returns same DataNode (K8s reschedule) 3. IP/PublicUrl are updated when node reconnects with new address 4. Different id creates new DataNode 5. Empty id falls back to ip:port (backward compatibility) Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * pb: add address field to DataNodeInfo for proper node addressing Previously, DataNodeInfo.Id was used as the node address, which worked when Id was always ip:port. Now that Id can be an explicit string, we need a separate Address field for connection purposes. Changes: - Add 'address' field to DataNodeInfo protobuf message - Update ToDataNodeInfo() to populate the address field - Update NewServerAddressFromDataNode() to use Address (with Id fallback) - Fix LookupEcVolume to use dn.Url() instead of dn.Id() Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * fix: trim whitespace from volume server id and fix test - Trim whitespace from -id flag to treat ' ' as empty - Fix store_load_balancing_test.go to include id parameter in NewStore call Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * refactor: extract GetVolumeServerId to util package Move the volume server ID determination logic to a shared utility function to avoid code duplication between volume.go and rack.go. Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * fix: improve transition logic for legacy nodes - Use exact ip:port match instead of net.SplitHostPort heuristic - Update GrpcPort and PublicUrl during transition for consistency - Remove unused net import Ref: https://github.com/seaweedfs/seaweedfs/issues/7487 * fix: add id normalization and address change logging - Normalize id parameter at function boundary (trim whitespace) - Log when DataNode IP:Port changes (helps debug K8s pod rescheduling) Ref: https://github.com/seaweedfs/seaweedfs/issues/7487
2024-11-03fix deadlock hang when broadcast to clients (#6184)wyang1-5/+12
fix deadlock when broadcast to clients when master thransfer leader, the old master will disconnect with all filers and volumeServers, if the cluster is a big , the broadcast messages may be more big than the max of the channel len 100, then if the KeepConnect was not listen on the channel in disconnect, it will deadlock. and the whole cluster will not serve!
2024-09-24fix unclaimed spaces calculation when volumePreallocate is enabled (#6063)LHHDZ1-0/+1
the calculation of `unclaimedSpaces` only needs to subtract `unusedSpace` when `preallocate` is not enabled. Signed-off-by: LHHDZ <shichanglin5@qq.com>
2024-08-16fix ec volume lookup data sync (#5900)augustazz1-2/+2
2024-06-07fix: Ensure that the clientAddress is unique (#5655)steve.wei1-1/+7
2024-06-06Fix panic (#5654)Gaspare Iengo1-2/+4
2024-06-05Set the capacity of clientChan to 10000 (#5647)steve.wei1-2/+1
2024-06-03fix deadlock caused by message chan blocked (#5639)LHHDZ1-0/+8
2024-05-29pass along volume server grpc portchrislu1-0/+2
fix https://github.com/seaweedfs/seaweedfs/issues/5617
2024-05-24avoid ticker leakchrislu1-0/+1
2024-01-10chore: add status code for request_total metrics (#5188)Konstantin Lebedev1-2/+2
2022-10-07metric shows who is currently blocking the cluster or not (#3799)Konstantin Lebedev1-0/+2
* master_admin_lock Shows whether cluster is locked now or not https://github.com/seaweedfs/seaweedfs/issues/3452 * fix metric MasterAdminLock
2022-09-11skip deltaBeat if dn is zero (#3630)Konstantin Lebedev1-4/+11
* skip deltaBeat https://github.com/seaweedfs/seaweedfs/issues/3629 * fix GrpcPort * skip url :0 * skip empty DataCenter or Rack * skip empty heartbeat Ip * dell msg add DataCenter * comment todo * fix
2022-09-07refactor https://github.com/seaweedfs/seaweedfs/pull/3616 (#3625)Konstantin Lebedev1-106/+106
2022-09-07fix:Sometimes a nil pointer exception is thrown (#3618)famosss1-1/+5
2022-09-07fix: volume heartbeat processing error (#3616)famosss1-90/+92
2022-08-26fix: Build DeletedVids before reset dn's children (#3530)famosss1-5/+6
2022-08-04filer prefer volume server in same data center (#3405)Konstantin Lebedev1-5/+1
* initial prefer same data center https://github.com/seaweedfs/seaweedfs/issues/3404 * GetDataCenter * prefer same data center for ReplicationSource * GetDataCenterId * remove glog
2022-07-29move to https://github.com/seaweedfs/seaweedfschrislu1-9/+9
2022-07-28refactorchrislu1-1/+1
2022-07-28add dc and rackchrislu1-2/+3
2022-07-27"github.com/chrislusf/raft" => "github.com/seaweedfs/raft"chrislu1-1/+1
2022-06-27avoid set currentMaster k8s svc.local discoveruy service domainsKonstantin Lebedev1-2/+6
https://github.com/chrislusf/seaweedfs/issues/2589
2022-06-11go fmtchrislu1-1/+1
2022-05-17fix naming conventionguol-fnst1-23/+27
notify volume server of duplicate directoris improve searching efficiency
2022-05-17rename UUID fileguol-fnst1-1/+1
fix typo move locationUUID into DiskLocation
2022-05-16avoid duplicated volume directoryguol-fnst1-3/+50
2022-05-01filer: add filer groupchrislu1-5/+5
2022-04-07fix: master lose some volumesshibinbin1-0/+3
2022-04-05erasure coding: tracking encoded/decoded volumeschrislu1-6/+6
If an EC shard is created but not spread to other servers, the masterclient would think this shard is not located here.
2022-01-24metrics master is leaderKonstantin Lebedev1-0/+3
2022-01-24new master metricsKonstantin Lebedev1-2/+15
2021-11-06send peers info to filersChris Lu1-16/+19
2021-11-05refactor grpc APIChris Lu1-4/+6
2021-11-05Revert "master: rename grpc function KeepConnected() to ↵Chris Lu1-4/+4
SubscribeVolumeLocationUpdates()" This reverts commit af71ae11aa29350a60ed7d3b9a16276a06ba9dcc.
2021-11-03master: rename grpc function KeepConnected() to SubscribeVolumeLocationUpdates()Chris Lu1-4/+4
2021-11-02shell: optionally read filer address from masterChris Lu1-16/+6
2021-09-14go fmtChris Lu1-1/+1
2021-09-12change server address from string to a typeChris Lu1-7/+8
2021-09-11log formatChris Lu1-1/+1
2021-09-11increase counter only if not early terminatedChris Lu1-3/+2
2021-09-07handle ipv6 addressesChris Lu1-2/+2
2021-09-05fix formatChris Lu1-1/+1
2021-09-05master: disconnect only the phantom volume serverChris Lu1-1/+6
fix https://github.com/chrislusf/seaweedfs/issues/2311
2021-08-14renameChris Lu1-5/+5
2021-08-12adjust data typeChris Lu1-0/+2
2021-06-12minorChris Lu1-2/+2
2021-03-22avoid possible nilChris Lu1-1/+5
fix https://github.com/chrislusf/seaweedfs/issues/1928 The nil was because of `dn.Parent().UnlinkChildNode(dn.Id())` in topo.UnRegisterDataNode() function, when the dn leaves the cluster.
2021-02-16this can compile now!!!Chris Lu1-9/+2