Bug #29948
closedUnable to re-import subscriptions in large environment (60k+ content hosts)
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1840784
A scenario occurred where we had to re-import subscriptions from Candlepin to Katello in a large customer environment but hit a scaling error:
User.current = User.anonymous_admin
m = Katello::Subscription
m.import_all
m = Katello::Pool
m.import_all
Traceback (most recent call last):
7: from lib/tasks/console.rake:5:in `block in <top (required)>'
6: from (irb):6
5: from katello (3.14.0.20) app/models/katello/glue/candlepin/candlepin_object.rb:40:in `import_all'
4: from katello (3.14.0.20) app/models/katello/glue/candlepin/candlepin_object.rb:44:in `block in import_all'
3: from katello (3.14.0.20) app/models/katello/glue/candlepin/candlepin_object.rb:47:in `block (2 levels) in import_all'
2: from katello (3.14.0.20) app/models/katello/glue/candlepin/pool.rb:192:in `import_managed_associations'
1: from katello (3.14.0.20) app/models/katello/glue/candlepin/pool.rb:169:in `import_hosts'
ActiveRecord::StatementInvalid (PG::ProtocolViolation: ERROR: invalid message format)
: SELECT id, host_id FROM "katello_subscription_facets" WHERE "katello_subscription_facets"."uuid" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53, $54, $55, $56, $57, $58, $59, $60, $61, $62, $63, $64, $65, $66, $67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77, $78, $79, $80, $81, $82, $83, $84, $85, $86, $87, $88, $89, $90, $91, $92, $93, $94, $95, $96, $97,