fix: fence command events by dispatch generation
This commit is contained in:
@@ -32,19 +32,20 @@ type FaultInjectorFunc func(name string) error
|
||||
func (function FaultInjectorFunc) Checkpoint(name string) error { return function(name) }
|
||||
|
||||
type EventAppend struct {
|
||||
IssueUUID [16]byte
|
||||
ClientID string
|
||||
EventSeq uint64
|
||||
ObservedUnixNano int64
|
||||
ReceiptUnixNano int64
|
||||
EventType uint16
|
||||
Stream uint16
|
||||
Compression uint16
|
||||
RawLength uint64
|
||||
Payload []byte
|
||||
ImmutableSHA256 [32]byte
|
||||
Output bool
|
||||
UseCloseout bool
|
||||
IssueUUID [16]byte
|
||||
ClientID string
|
||||
SessionGeneration uint64
|
||||
EventSeq uint64
|
||||
ObservedUnixNano int64
|
||||
ReceiptUnixNano int64
|
||||
EventType uint16
|
||||
Stream uint16
|
||||
Compression uint16
|
||||
RawLength uint64
|
||||
Payload []byte
|
||||
ImmutableSHA256 [32]byte
|
||||
Output bool
|
||||
UseCloseout bool
|
||||
}
|
||||
|
||||
type EventAppendResult struct {
|
||||
@@ -91,6 +92,10 @@ JOIN storage_counters ON storage_counters.singleton = 1 WHERE commands.issue_uui
|
||||
query += ` AND commands.client_id = ?`
|
||||
arguments = append(arguments, event.ClientID)
|
||||
}
|
||||
if event.SessionGeneration != 0 {
|
||||
query += ` AND commands.target_session_generation = ?`
|
||||
arguments = append(arguments, event.SessionGeneration)
|
||||
}
|
||||
err = database.QueryRowContext(ctx, query, arguments...).Scan(
|
||||
&lastSequence, &commandOutputCharged, &commandCharged, &closeoutRemaining, &clientID, &clientCharged, &serverCharged)
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
|
||||
Reference in New Issue
Block a user