Skip to content

Commit 0bb7fb2

Browse files
Merge pull request #1268 from darren/fix-scorch-on-rpi
scorch: fix crashes on ARM due to mis-aligned atomic access
2 parents 4a7e6fb + d9fc1b7 commit 0bb7fb2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index/scorch/scorch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ const Version uint8 = 2
4141
var ErrClosed = fmt.Errorf("scorch closed")
4242

4343
type Scorch struct {
44+
nextSegmentID uint64
45+
stats Stats
46+
iStats internalStats
47+
4448
readOnly bool
4549
version uint8
4650
config map[string]interface{}
4751
analysisQueue *index.AnalysisQueue
48-
stats Stats
49-
nextSegmentID uint64
5052
path string
5153

5254
unsafeBatch bool
@@ -73,8 +75,6 @@ type Scorch struct {
7375
onEvent func(event Event)
7476
onAsyncError func(err error)
7577

76-
iStats internalStats
77-
7878
pauseLock sync.RWMutex
7979

8080
pauseCount uint64

index/scorch/snapshot_segment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ func (cfd *cachedFieldDocs) prepareField(field string, ss *SegmentSnapshot) {
183183
}
184184

185185
type cachedDocs struct {
186+
size uint64
186187
m sync.Mutex // As the cache is asynchronously prepared, need a lock
187188
cache map[string]*cachedFieldDocs // Keyed by field
188-
size uint64
189189
}
190190

191191
func (c *cachedDocs) prepareFields(wantedFields []string, ss *SegmentSnapshot) error {

0 commit comments

Comments
 (0)