Summary

Setting a database prefix to a non-empty value makes the kafka module unusable. Most production sites wouldn't use database prefixes, but this is still a fairly severe issue since it prevents writing kernel or functional tests that depend on this module. This is because such tests set up a database with a random prefix to prevent test collisions.

Steps to Reproduce

1. Install your site with a database prefix set to a non-empty value:

$databases['default']['default']['prefix'] = 'test_';

2. Make sure 'some_topic' exists in your kafka cluster.
3. Call:

\Drupal::service('kafka.queue')->get('some_topic')->createQueue();

4. Observe error:
Base table or view not found: 1146 Table 'drupal.kafka_queue' doesn't exist

Expected Results

The functionality of the kafka module should not change, regardless of whether a database prefix is set.

Comments

christophersmith262 created an issue. See original summary.

christophersmith262’s picture

Issue summary: View changes
christophersmith262’s picture

StatusFileSize
new673 bytes
christophersmith262’s picture

Status: Active » Needs review

  • fgm committed 2b1c798 on 8.x-1.x
    Issue #3120946 by christophersmith262: Support prefixed databases.
    
fgm’s picture

Status: Needs review » Fixed

Merged to today's HEAD, thanks.

Now, how comes a site of the size needing to use Kafka if also using prefixed databases ? I never imagined it could happen.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.