Commit 1e91ac5
committed
multilevel: a chain with any writable level is writable
MultiLevelStorage::check() started from ReadWrite and demoted the
composite to ReadOnly as soon as any level reported ReadOnly. The
server then wraps the whole storage in ReadOnlyStorage, so every cache
write is refused before any write-error policy is consulted, including
writes to writable levels and preprocessor cache updates.
That inverts the documented semantics: MultiLevel.md promises that
read-only levels are "automatically skipped during writes, regardless
of write policy", and put() already implements exactly that per-level
skipping. The practical fallout is that the documented read-only
fallback topology (fast writable local disk in front of a read-only
shared remote, e.g. SCCACHE_S3_RW_MODE=READ_ONLY or an azure SAS token
without write permission) silently stops populating the local disk
cache entirely.
Aggregate in the other direction: the composite is writable when any
level is writable, and read-only only when every level is read-only.
The existing single-level read-only test still passes; new tests cover
mixed chains in both orders and the all-read-only chain.
Fixes #2773
Signed-off-by: Steven Noonan <steven@edera.dev>1 parent 7cd4f2c commit 1e91ac5
2 files changed
Lines changed: 74 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
880 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
881 | 889 | | |
882 | 890 | | |
883 | 891 | | |
884 | | - | |
885 | 892 | | |
886 | 893 | | |
887 | 894 | | |
| 895 | + | |
888 | 896 | | |
889 | 897 | | |
890 | 898 | | |
| |||
893 | 901 | | |
894 | 902 | | |
895 | 903 | | |
| 904 | + | |
896 | 905 | | |
897 | 906 | | |
898 | 907 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
973 | 1036 | | |
974 | 1037 | | |
975 | 1038 | | |
| |||
0 commit comments