(from, to tsdbState)
| 451 | } |
| 452 | |
| 453 | func (u *userTSDB) casState(from, to tsdbState) bool { |
| 454 | u.stateMtx.Lock() |
| 455 | defer u.stateMtx.Unlock() |
| 456 | |
| 457 | if u.state != from { |
| 458 | return false |
| 459 | } |
| 460 | u.state = to |
| 461 | return true |
| 462 | } |
| 463 | |
| 464 | // compactHead compacts the Head block at specified block durations avoiding a single huge block. |
| 465 | func (u *userTSDB) compactHead(ctx context.Context, blockDuration int64) error { |
no outgoing calls