Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 88c309b

Browse files
committed
fine tune how often/fast we retry meta record cql queries
1 parent 581656d commit 88c309b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

idx/cassandra/cassandra.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ var (
5252
statSaveSkipped = stats.NewCounter32("idx.cassandra.save.skipped")
5353
errmetrics = cassandra.NewErrMetrics("idx.cassandra")
5454

55+
// try executing each query 10 times
56+
// when a query fails we retry 9 times with the following sleep times in-between
57+
// 100ms, 200ms, 400ms, 800ms, 1.6s, 3.2s, 6.4s, 12.8s, 20s
58+
// the total time to fail is 45.5s, which is less than the default http timeout
5559
metaRecordRetryPolicy = gocql.ExponentialBackoffRetryPolicy{
56-
NumRetries: 10,
57-
Min: time.Millisecond * time.Duration(10),
58-
Max: time.Second,
60+
NumRetries: 9,
61+
Min: time.Millisecond * time.Duration(100),
62+
Max: time.Second * time.Duration(20),
5963
}
6064
)
6165

0 commit comments

Comments
 (0)