My rule runs for about 12 mins and then times out. Is there a setting I can change in Data Masker? Or is this something that needs to be changed in SQL Server itself?
Hi @dprince Thank you very much for your question!
When you say "times out" could you let me know a bit more information please? (the exact error message, the type of rule you're running, how many rows in the table and how many columns you're trying to mask etc. would be super helpful!) Also if you could share the version of Data Masker you're working with, that would be great please!
Just as a 'starter-for-10' - the most often timeout issues we see relate largely to rules trying to commit too many changes at once. The logic within Data Masker for SQL Server means it tries to dynamically calculate the maximum number of rows it can update in each batch, which as you can imagine, sometimes it thinks a bit much of itself!
The easiest way to fix this, for instance in an timing out Substitution rule, would be to: 1) Add an Index refresh rule and a Row Count refresh rule to rule block 00 (dependent on the trigger manager) - just so that DMS is always up to date on what it's running against! 2) Open the problematic rule and go to the Errors & Options tab, and where it specifies the Commit Frequency as 'Default' change this to user specified. About 100,000 I often feel does pretty well, and you can tweak it either side as neccessary!
If the above doesn't help, please feel free to confirm the above information and we'll do all we can to help out
Data Masker Version 6.2.4.1985. I will try the commit frequency change and let you know the results. Here is the segment from my error log file. It looks like the number of rows attempting to be updated is 121,752. Thanks!
07/01/2020 04:19:59 DMS_Common.RuleWorker: Exception in ProcessSubstitutionRule, Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding., trace= at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.SqlInternalTransaction.Commit()
at System.Data.SqlClient.SqlTransaction.Commit()
at DMS_Common.RuleWorker.ProcessSubstitutionRule(DMSRule_Controller controllerObj, DMSRule_Substitution subRuleObj)
07/01/2020 04:19:59 DMS_Common.RuleWorker: RuleWorkerLoop runID=underwriting.dbo.tables::202007010418321402268, workerID=1, Exception occurred, now handling
07/01/2020 04:19:59 DMS_Common.DMSRule_Substitution: Substitution Rule, RuleID=01-0005, RowsToProcess=17687, ColsToProcess=0, Total Rows/Second=0, RowOperations=0, Total Cols/Second=0, ColOperations=0, TotalProcessingTimeInSeconds=82
07/01/2020 04:19:59 DMS_Common.RuleWorker: HandleRuleWorkerLoopException: runID=underwriting.dbo.tables::202007010418321402268, workerID=1, rule=01-0005, SQL Server exception happened. Checking for ERRTRAP
07/01/2020 04:19:59 DMS_Common.RuleWorker: HandleRuleWorkerLoopException: runID=underwriting.dbo.tables::202007010418321402268, workerID=1, rule=01-0005, ENDING on SQL Server error
07/01/2020 04:19:59 DMS_Common.RuleWorker: HandleRuleWorkerLoopException runID=underwriting.dbo.tables::202007010418321402268, workerID=1, Rule 01-0005, exception=Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
07/01/2020 04:19:59 DMS_Common.RuleWorker: SQL Code for Rule 01-0005:UPDATE [underwriting_TMP].[dbo].[TblRequestToBind] set [Address]=CASE WHEN [Address] IS NULL THEN cast(NULL as nvarchar(150)) WHEN [Address] = '' THEN '' ELSE @u_Address END, [Phone]=CASE WHEN [Phone] IS NULL THEN cast(NULL as nvarchar(50)) WHEN [Phone] = '' THEN '' ELSE @u_Phone END, [Fax]=CASE WHEN [Fax] IS NULL THEN cast(NULL as nvarchar(50)) WHEN [Fax] = '' THEN '' ELSE @u_Fax END, [InsuredName]=CASE WHEN [InsuredName] IS NULL THEN cast(NULL as nvarchar(250)) WHEN [InsuredName] = '' THEN '' ELSE @u_InsuredName END, [DBA]=CASE WHEN [DBA] IS NULL THEN cast(NULL as nvarchar(250)) WHEN [DBA] = '' THEN '' ELSE @u_DBA END, [E-Mail]=CASE WHEN [E-Mail] IS NULL THEN cast(NULL as nvarchar(255)) WHEN [E-Mail] = '' THEN '' ELSE @u_EÄDMÅMail END where [AutoID] = @r_AutoID
07/01/2020 04:30:27 DMS_Common.DMSRuleSchedulingEngine: ProcessAllControllersAllRules(stop C) RunID=underwriting.dbo.tables::202007010418321402268, Controller 01-0001, Rule block 01. Rule processing stopped due to an error in rule 01-0005
07/01/2020 04:30:27 DMS_Common.DMSRuleSchedulingEngine: HandleWorkerManagerLoopException runID=underwriting.dbo.tables::202007010418321402268, StackTrace= at DMS_Common.DMSRuleSchedulingEngine.ProcessAllControllersAllRules(RuleStageEnum currentStage)
at DMS_Common.DMSRuleSchedulingEngine.WorkerManagerLoop()
07/01/2020 04:30:27 DMS_Common.DMSRuleSchedulingEngine: HandleWorkerManagerLoopException runID=underwriting.dbo.tables::202007010418321402268, Rule run failed
07/01/2020 04:30:27 DMS_Common.DMSRuleSchedulingEngine: HandleWorkerManagerLoopException runID=underwriting.dbo.tables::202007010418321402268, Error=Rule execution stopped due to error in rule 01-0005
07/01/2020 04:30:27 DMS_CmdLine.CmdLineMain: WorkerManagerReport for RunID=underwriting.dbo.tables::202007010418321402268, Status=RULERUN_FAILED
07/01/2020 04:30:27 N2KCommon.MaskingRunStateMachine: RunStateMachineBase: state change. Old=SETRUNSTATE_RUNNING new=SETRUNSTATE_FAILED
07/01/2020 04:30:27 DMS_CmdLine.CmdLineMain: Rule Run FAILED, please see the log file, now closing
07/01/2020 04:30:27 DMS_Common.DMSRuleSchedulingEngine: WorkerManagerLoop:, Processing stopped due to failure, now resetting worker manager
Thanks for sending this across @dprince - this does look like something that could be improved with a manual commit frequency, let me know how you get on!
I see the "Commit Frequency", but there is not place for "default". It is already set to 1000 by default in each of the rules. Do I need a newer version of Data Masker?
Aha @dprince apologies I completely missed where you mentioned your version!! Yes please, the latest version of DMS is significantly further ahead! Please feel free to upgrade first and THEN give this a go!
Answers
When you say "times out" could you let me know a bit more information please? (the exact error message, the type of rule you're running, how many rows in the table and how many columns you're trying to mask etc. would be super helpful!)
Also if you could share the version of Data Masker you're working with, that would be great please!
Just as a 'starter-for-10' - the most often timeout issues we see relate largely to rules trying to commit too many changes at once. The logic within Data Masker for SQL Server means it tries to dynamically calculate the maximum number of rows it can update in each batch, which as you can imagine, sometimes it thinks a bit much of itself!
The easiest way to fix this, for instance in an timing out Substitution rule, would be to:
1) Add an Index refresh rule and a Row Count refresh rule to rule block 00 (dependent on the trigger manager) - just so that DMS is always up to date on what it's running against!
2) Open the problematic rule and go to the Errors & Options tab, and where it specifies the Commit Frequency as 'Default' change this to user specified. About 100,000 I often feel does pretty well, and you can tweak it either side as neccessary!
If the above doesn't help, please feel free to confirm the above information and we'll do all we can to help out
Thank you very much!
Yes please, the latest version of DMS is significantly further ahead! Please feel free to upgrade first and THEN give this a go!