Question

How to clear caches in 8.1

In 8.1, SMA is no longer a thing. How do I clear various caches in 8.1? In particular, I'm trying to clear the rule resolution cache.

Correct Answer
September 24, 2019 - 12:24pm

Hello Jerome

Thanks for pointing out your problem with Custom Functions (RUFs) not being recognized!  Yes, that problem did exist and has been resolved in all current up to date patch releases of Pega 8 Infinity.   e.g (8.1.6, 8.2.3, 8.3, etc.)

With that change, I hope that you never have to do those table truncations again

Thanks

Comments

Keep up to date on this post and subscribe to comments

November 28, 2018 - 11:27am

You can clear the caches using the Pega API api

Cache Management (Pega API)

  • REST APIs to manage VTable Cache across all nodes in the cluster
  • REST APIs to manage Conclusion Cache across all nodes in the cluster
  • REST APIs to manage Declarative Page Cache across all nodes in the cluster
  • REST APIs to manage Declarative Rule Cache across all nodes in the cluster
  • REST APIs to manage Rule Cache across all nodes in the cluster
  • REST APIs to clear ABA Cache across all nodes in the cluster
  • REST APIs to list and clear requestor pools across all nodes in the cluster

to use the Pega API - you can switch to the Admin Studio workspace - see https://community.pega.com/sites/default/files/help_v81/pxadminstudio/procomhelpmain.htm 

and open the Pega API page - it will list all the entry point for the Pega API 

 

for more details https://community.pega.com/knowledgebase/articles/pega-api-pega-platform 

November 30, 2018 - 7:42am

Thanks Richard.  Do you know if there are any future plans to add calls to these API into the admin portal in a more user friendly type of manor?  I suppose that I could build that functionality into our environment, but I'll not worry about it if it is something that may be an enhancement in the future.

Also, just before seeing your comment, I ran the following query and did a cycle, which ultimately fixed my issue as well.  Next time, I will give the API a try.

truncate table pegadata.pr_sys_queue_ftsindexer;
truncate table pegadata.pr_sys_queues;
truncate table pegadata.pr_log;
truncate table pegadata.pc_history_work;
truncate table pegadata.pr_sys_statusnodes;
truncate table pegarules.PR_SYS_CACHE_ENTRY;
truncate table pegarules.PR_SYS_CACHE_IMPL;
truncate table pegarules.PR_SYS_CACHE_DEP;
truncate table pegarules.PR4_rule_sysgen;
truncate table pegarules.pr_assembledclasses;

November 30, 2018 - 9:06am
Response to Jerome@quavo

I highly recommend to stop using sql queries to clear the caches.

The Rest API are available because they can easily be integrated into any remote management utilities and are a much more convenient way to administrate the system rather than using SMA. In 8.1, SMA is no longer shipped into the distribution. From the landing page, you can easily initiate the REST endpoint call if you open the swagger of the API.

March 3, 2019 - 9:35pm

Every install into an 8.x environment that I have performed has required the truncation of the previously mentioned tables.  Until doing so, our custom functions/function libraries are not recognized.  I've tried regenerating the libraries and functions (which is successful), as well as cycling the environment with extract file removal, however I still have the issue.  I've performed the same imports into our own AWS instances, and it always works as expected.  Also, if I private edit the data transform that calls the function, it is able to properly run the rule.  The issue seems to be with some level of caching of the calling rules and/or the functions.  The API are not completely straightforward, and I've not been able to alleviate the problem by calling any of them.  Is this something that anyone else has ran in to?  The issue only seems to present itself on pega cloud instances.  I have had this issue on all versions of 8.1.x.

Pega
September 24, 2019 - 12:24pm
Response to Jerome@quavo

Hello Jerome

Thanks for pointing out your problem with Custom Functions (RUFs) not being recognized!  Yes, that problem did exist and has been resolved in all current up to date patch releases of Pega 8 Infinity.   e.g (8.1.6, 8.2.3, 8.3, etc.)

With that change, I hope that you never have to do those table truncations again

Thanks

April 23, 2019 - 10:02am

when I tried to clear the rule cache, it asks for a user name and password what credentials should be give here? which config file can we find this?

April 23, 2019 - 10:24am
Response to ManjuPai

You should be able to pass it your personal operator and password.  

 

Additionally, I've noticed that the /nodes/{nodeID}/caches/conclusion/clear api requires a "source" value.  If you want to run this, the source should be "Memory" or "Database".  This is not documented anywhere.  @pega, it would be great if the api had documentation specifying any other required parameters, or if the admin portal included mini wizards that would auto populate and/or provide dropdowns that prompted valid entries for any required inputs.

April 23, 2019 - 11:00am
Response to Jerome@quavo

I tried using my operator credentials and it returned 401 with no content.  Going by the description it means Unauthorized. 

June 10, 2019 - 5:53pm

I've now ran into this issue 5 or 6 times.  Usually, I just stumble around flushing caches, manually truncating tables, and cycling until the function library is able to be recognized.  Is there some magic that I am missing?  This seems to only be an issue upon initial import.  

Pega
June 11, 2019 - 2:27am