Open trekhopton opened 5 days ago
The query is evidently attempting to use an index that does not exist:
no matching index found.
What is the query?
The function that tries to get the voltage is in revidCameraClient.voltage, broadcast_hardware_machine ln:452.
Which ends up calling GetLatestScalar.
func GetLatestScalar(ctx context.Context, store datastore.Store, id int64) (*Scalar, error) {
const countPeriod = 60 * time.Minute
start := time.Now().Add(-countPeriod).Unix()
keys, err := GetScalarKeys(ctx, store, id, []int64{start, -1})
if err != nil {
return nil, err
}
if len(keys) == 0 {
return nil, datastore.ErrNoSuchEntity
}
_, ts, _ := datastore.SplitIDKey(keys[len(keys)-1].ID)
return GetScalar(ctx, store, id, ts)
}
This filters by ID and timestamp.
Then the key is retrieved and used to try and get the scalar.
// GetScalar gets a single scalar by ID and timestamp.
func GetScalar(ctx context.Context, store datastore.Store, id int64, ts int64) (*Scalar, error) {
key := store.IDKey(typeScalar, datastore.IDKey(id, ts, 0))
s := new(Scalar)
err := store.Get(ctx, key, s)
if err != nil {
return nil, err
}
return s, nil
}
It seems like Id and timestamp are indexed:
vidgrind_index.yaml has:
- kind: Scalar
properties:
- name: ID
- name: Timestamp
That index is correct, and I can confirm that the index also exists in production.
For some reason the broadcast hardware machine can't get the latest voltage scalar, despite the configuration seeming to be correct.
This results in the broadcast stopping and disabling itself. We can't use this currently so I'll have to roll back to a previous version of oceantv.