Can two connections on separate instances share a scratch schema/PDTs? aka Enemy Reaper

Knowledge Drop

Last tested: May 11, 2020

TL/DR: Don't share the schema! Two instances should not share the same scratch schema because they can hit the "enemy reaper" scenario. PDTs CAN be shared using the publish_as_db_view feature (detailed below)

The PDT Reaper cleans up (deletes) any tables that are expired. In the "enemy reaper" scenario, the reaper for one instance shares a connection registration key (the two letters after $ in the PDT name) and will delete all PDTs with the same reg key that are not listed in the "active_derived_table" internal db table. PDTs that were created by the other instance will not be here, so they will be deleted, and the other instance will do the same thing. Thus, all PDTs will constantly be being deleted. The most common way for instances to possibly have the same reg key would be sharing license keys.

To share PDTs across instances, you should use publish_as_db_view. This way, one instance can create the PDT and be in charge of maintaining it, while the other one simply selects * from the view. This entirely avoids the enemy reaper scenario. Example here: https://docs.looker.com/reference/view-params/publish_as_db_view#accessing_the_pdt_stable_database_v...

This content is subject to limited support.                

Version history
Last update:
‎05-07-2021 09:10 AM
Updated by: