Select the types of activity you want to include in your feed.
Support reading v15 shards (#22)
We can update our read code to support reading older shards. This will allow us
to continue serving indexed search when we are busy re-indexing everything from
v15 to v16.
···14141515package zoekt
16161717-// FormatVersion is a version number. It is increased every time the
1717+// IndexFormatVersion is a version number. It is increased every time the
1818// on-disk index format is changed.
1919// 5: subrepositories.
2020// 6: remove size prefix for posting varint list.
···4242// 9: Store ctags metadata
4343const FeatureVersion = 9
44444545+func init() {
4646+ ensureSourcegraphSymbolsHack()
4747+}
4848+4949+func ensureSourcegraphSymbolsHack() {
5050+ if IndexFormatVersion != 16 {
5151+ panic(`Sourcegraph: While we are on version 16 we have added code into
5252+ read.go which supports reading IndexFormatVersion 15. If you change the
5353+ IndexFormatVersion please reach out to Kevin and Keegan.`)
5454+ }
5555+ if FeatureVersion != 9 {
5656+ panic(`Sourcegraph: While we are on FeatureVersion 9 we have added code into
5757+ read.go which supports reading FeatureVersion 8. If you change the
5858+ FeatureVersion please reach out to Kevin and Keegan.`)
5959+ }
6060+}
6161+4562type indexTOC struct {
4663 fileContents compoundSection
4764 fileNames compoundSection
···6986 nameEndRunes simpleSection
7087 contentChecksums simpleSection
7188 runeDocSections simpleSection
8989+}
9090+9191+func (t *indexTOC) sectionsHACK(expectedSectionCount uint32) []section {
9292+ ensureSourcegraphSymbolsHack()
9393+9494+ // Sourcegraph hack for v15.
9595+ if expectedSectionCount == 19 {
9696+ return []section{
9797+ // This must be first, so it can be reliably read across
9898+ // file format versions.
9999+ &t.metaData,
100100+ &t.repoMetaData,
101101+ &t.fileContents,
102102+ &t.fileNames,
103103+ &t.fileSections,
104104+ &t.newlines,
105105+ &t.ngramText,
106106+ &t.postings,
107107+ &t.nameNgramText,
108108+ &t.namePostings,
109109+ &t.branchMasks,
110110+ &t.subRepos,
111111+ &t.runeOffsets,
112112+ &t.nameRuneOffsets,
113113+ &t.fileEndRunes,
114114+ &t.nameEndRunes,
115115+ &t.contentChecksums,
116116+ &t.languages,
117117+ &t.runeDocSections,
118118+ }
119119+ }
120120+121121+ return t.sections()
72122}
7312374124func (t *indexTOC) sections() []section {