From f0eb25b3c550c3f2e696af7f9e58d36d0b2c9738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Tue, 5 Feb 2019 15:07:30 +0000 Subject: [PATCH] pstore ds: enforce order in gc queries. --- pstoreds/addr_book_gc.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pstoreds/addr_book_gc.go b/pstoreds/addr_book_gc.go index a0212fa..2c45b86 100644 --- a/pstoreds/addr_book_gc.go +++ b/pstoreds/addr_book_gc.go @@ -23,8 +23,16 @@ var ( // in GC routines, how many operations do we place in a batch before it's committed. gcOpsPerBatch = 20 // queries - purgeQuery = query.Query{Prefix: gcLookaheadBase.String(), KeysOnly: true} - populateLookaheadQuery = query.Query{Prefix: addrBookBase.String(), KeysOnly: true} + purgeQuery = query.Query{ + Prefix: gcLookaheadBase.String(), + Orders: []query.Order{query.OrderByKey{}}, + KeysOnly: true, + } + populateLookaheadQuery = query.Query{ + Prefix: addrBookBase.String(), + Orders: []query.Order{query.OrderByKey{}}, + KeysOnly: true, + } ) // cyclicBatch is similar to go-datastore autobatch, but it's driven by an actual Batch facility offered by the