Skip to content

Commit

Permalink
Prevent a cursor timeout when syncing rpm repos
Browse files Browse the repository at this point in the history
I couldn't actually reproduce the cursor timeout using a variety of
configurations for my VM but using a batch size here didn't seem to slow
down syncs significantly.

fixes #2502
https://pulp.plan.io/issues/2502
  • Loading branch information
David Davis committed Jan 13, 2017
1 parent 65525da commit b4d57ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/pulp_rpm/plugins/importers/yum/purge.py
Expand Up @@ -393,7 +393,9 @@ def _duplicate_key_id_generator_aggregation(unit, fields):

# When aggregating over hundreds of thousands of packages, mongo can overflow
# To prevent this, mongo needs to be allowed to temporarily use the disk for this transaction
aggregation = unit.objects.aggregate(sort, project, allowDiskUse=True)
# Set the batch size to 5 to prevent a cursor timeout
aggregation = unit.objects.aggregate(sort, project, allowDiskUse=True,
batchSize=5)

# loop state tracking vars
previous_nevra = None
Expand Down

0 comments on commit b4d57ec

Please sign in to comment.