View the original community article here
Last tested: Dec 27, 2018
Say the regenerator runs the trigger query, and the trigger value of a PDT changes. Does the old table get dropped immediately or after the rebuild? What about when we change the code of a PDT, for example the
sql_trigger_value , and push it to prod?
If just the trigger value has changed, and no code changes have been pushed to production, we will use the old version of the PDT until the new version is built. This will show up as "Using Old Version" in the PDT panel.
If any change in the SQL code of the PDT has been pushed to prod, including the
sql_trigger_value or datagroup code, we do NOT use the old version of the PDT—it is dropped immediately. Because the sql changed, the old version is no longer considered valid. The new one still has to build - that could mean a while before there is a valid PDT build in production.
If you make a change to a PDT, build it in dev first, then when you push, that PDT will get promoted to prod. (Of course, this won't be possible for PDTs that take longer than an hour to build.)
The regenerator process takes a look at the state of the model at the beginning of the regenerator thread. That is to say, it grabs the SQL of the PDTs at the beginning of the regenerator cycle. So if you push changes between when the regenerator cycle started and when that particular PDT gets built, we will build the old version of the PDT, which essentially, is invalid because you pushed a new trigger value which changes the validity of when that PDT should be built.
So what will happen is, the next time the regenerator cycle starts, it will have to build that new PDT for there to be a production version.