Modify Praefect's ServerInfo to return the primary's server info
Our existing implementation of ServerInfo in Praefect will break the rails code that gets the filesystem id. The reason is because https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/gitaly_client/server_service.rb#L31-33 will look in the response of the ServerInfo
RPC and look for the storage.
In the case of Praefect, this is the virtual storage. However, in our current implementation in https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/praefect/service/server/info.go#L44-64, we relay the request to all of the internal gitaly nodes, and aggregate these responses.
In so doing, we don't return anything to the client with the virtual storage. Also, this is not a "transparent" type behavior. To the rails client, it suddenly has all of this information about internal nodes.
Instead, I propose we modify this so that we return only 1 StorageStatus
per virtual storage, and base it off the primary.
current:
{
"serverVersion": "12.9.0-rc5-83-gbc2bf869",
"gitVersion": "2.25.0",
"storageStatuses": [
{
"storageName": "praefect-internal-0",
"readable": true,
"writeable": true,
"fsType": "apfs",
"filesystemId": "a1fc127d-f6e9-410f-b8b6-cca74362b832"
},
{
"storageName": "praefect-internal-1",
"readable": true,
"writeable": true,
"fsType": "apfs",
"filesystemId": "d2de74fe-ea39-44db-9af1-8f5845dc303b"
},
{
"storageName": "praefect-internal-2",
"readable": true,
"writeable": true,
"fsType": "apfs",
"filesystemId": "fa1d9d8b-4c05-4006-bc31-2a62f2ceebfa"
},
]
}
Proposal:
(in this case, the virtual_storage is default
)
{
"serverVersion": "12.9.0-rc5-83-gbc2bf869",
"gitVersion": "2.25.0",
"storageStatuses": [
{
"storageName": "default",
"readable": true,
"writeable": true,
"fsType": "apfs",
"filesystemId": "a1fc127d-f6e9-410f-b8b6-cca74362b832"
},
]
}