vlserver: fix missing read-only entries from ListAttributesN2
The ListAttributesN2() RPC can fail to list read-only entries under
certain circumstances. This RPC is used by the `vos listvldb` command to
retrieve vldb entries (unless the -name option is given). The `vos
listvldb` command fails to list volume entries when run with the
'-server' option for volumes that have read-only replicas, but have not
been released.
Consider the following example volume:
$ vos create fs1.example.com a test
$ vos addsite fs1.example.com a test
$ vos addsite fs2.example.com a test
$ vos listvldb
...
test
RWrite:
536870921
number of sites -> 3
server fs1.example.com partition /vicepa RW Site
server fs1.example.com partition /vicepa RO Site -- Not released
server fs2.example.com partition /vicepa RO Site -- Not released
`vos listvldb` fails to find the volume when the search is limited to
server 'fs2':
$ vos listvldb -server fs2.example.com
VLDB entries for server fs2.example.com
Total entries: 0
Instead of the expected results:
$ vos listvldb -server fs2.example.com
test
RWrite:
536870921
number of sites -> 3
server fs1.example.com partition /vicepa RW Site
server fs1.example.com partition /vicepa RO Site -- Not released
server fs2.example.com partition /vicepa RO Site -- Not released
This situation makes it difficult to remove old server addresses from
the vldb. In this situation, 'vos remaddrs' and 'vos changeaddr
-remove' commands will complain the server addresses are still in use by
volume entries, however running 'vos listvldb -server' will not show
which volumes entries are in use.
The entries are not listed for unreleased volumes because the
ListAttributesN2() RPC is currently checking the volume VLF_ROEXISTS
flag, instead of the server site flags (serverFlags) to determine when
the entry is a read-only site. The volume VLF_ROEXISTS flag is set when
a volume is released.
To fix this, make ListAttributesN2 check for the VLSF_ROVOL site flag,
instead of the VLF_ROEXISTS entry flag.
Change-Id: Ib636fbe016d1d2f5b117624d9930dba83ebcef8a
Reviewed-on: https://gerrit.openafs.org/14154
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>