Uploaded image for project: 'CFA MX '
  1. CFA MX
  2. CFAMX-10826

Request AWS Forecast page - Generating duplicate calls

    Details

    • Type: Sprint Defect
    • Status: Done (View Workflow)
    • Priority: Major
    • Resolution: Completed
    • Affects Version/s: CFA 2020R4
    • Fix Version/s: None
    • Component/s: AWS, Forecasting
    • Labels:
      None
    • SCRUM Team:
      Globogym Purple Cobras
    • Source Code ID(s):
    • Sprint:
      CFAMX 2020R4 SA Sprint 2, CFAMX 2020R4 SA Sprint 3

      Description

      When testing the changes that Caner Saritac made for the Forecast Accuracy I noticed that something is up with the Request AWS forecast page.
      I put this down to the Queue changes, which have been rolled back, so when testing the change from Colin Wyatt-Goodall to Delete the external generation date (CFAMX-10520) I looked again.

      1. The initial issue that I saw is that when Requesting multiple days from the page, the process fails (I actually noticed this last week when testing as well)
      2. When pulling one day at a time, things seem to work
      3. However, when a day is successfully pulled in, there are duplicate records in tbaudit, and duplicate records in forecasting.forecast
      4. For example:
        • select * from tbaudit with(nolock)
          where AuditDateTime > '2020-07-06'
          and EventEntityID = 1041
          and AuditCategoryID = 23
          -- AuditCategoryID = 23 used for Web Service Calls
          and AuditID in (350920, 350922, 350925)
          
        • select * from tbaudit with(nolock)
          where AuditDateTime > '2020-07-06'
          and EventEntityID = 1041
          and AuditCategoryID = 3
          -- AuditCategoryID = 3 used for imports
          and AuditID in (350927, 350928, 350929, 350939,350942)
          
        • select * from forecasting.forecast with(nolock)
          where EntityId = 1041
          and BusinessDay = '2020-07-23'
          
      5. Note: This does not seem to occur when the scheduled job runs, only when the page is used. Also, in looking back, Caner Saritac and I did see examples of duplicate forecast record in May and April. So while this is not necessarily related to the changes that Colin Wyatt-Goodall has made, it would be appreciated if you could take a look at it and track down what is happening
      6. We also noticed a weird error, being logged, which references saving a file to a folder, which is not quite how the forecast import works.
        • select * from tbaudit with(nolock)
          where AuditDateTime > '2020-07-06'
          and EventEntityID = 1041
          and AuditCategoryID = 23
          and AuditID in (350975, 350976)
          
        • Error getting or saving forecast data for 01919 from https://api.scforecast-test.cfadevelop.com/v1/forecast/status/01919?fromDate=07-22-2020&toDate=07-22-2020 to W:\Macromatix\SiteData\JATesting\DataImports\Forecast\Forecast_{storenumber}_{forecastdate}.xml: Can't Parse 0 as ForecastingSales
          

      Calls made by Request AWS Forecast page:

      • On page load, after selecting a store - Status Call for today's date
      • Expand the Date Range - Status Call using the selected dates as Start and End dates
      • Click on Request
        • Kick of the process to import forecasts
          • Status call
          • Process the results
          • Make Demand calls for those forecasts that are available (Latest Generation Date > External Generation Date
      select * from tbaudit with(nolock)
      where AuditDateTime > '2020-07-06'
      and EventEntityID = 1041
      and AuditCategoryID = 23
      and AuditID in (351420, 351421, 351424, 351425, 351426)
      
      • 351420 - Initial Status Call on page load (fromDate=07-06-2020&toDate=07-06-2020)
      • 351421 - Date range changed, to expand range (fromDate=07-06-2020&toDate=07-12-2020)
      • 351424 - Date range changed to select just three days (fromDate=07-06-2020&toDate=07-08-2020)
      • 351425 - Status Call after clicking on Request - (fromDate=07-06-2020&toDate=07-08-2020)
      • 351426 - Error message

      Cycle through dates one at a time, it still fails, what has happened to my forecast import process?

      select * from tbaudit with(nolock)
      where AuditDateTime > '2020-07-06 19:00:00.000'
      and EventEntityID = 1041
      and AuditCategoryID = 23
      and AuditID in (351436, 351437, 351438, 351439, 351440, 351441, 351442, 351443, 351444)
      

      Production config

        Attachments

        1. screenshot-3.png
          screenshot-3.png
          75 kB
        2. screenshot-2.png
          screenshot-2.png
          100 kB
        3. screenshot-1.png
          screenshot-1.png
          66 kB
        4. ProdConfig.png
          ProdConfig.png
          58 kB
        5. image-2020-07-17-10-58-35-750.png
          image-2020-07-17-10-58-35-750.png
          170 kB
        6. image-2020-07-06-15-19-52-957.png
          image-2020-07-06-15-19-52-957.png
          23 kB
        7. image-2020-07-06-15-16-17-564.png
          image-2020-07-06-15-16-17-564.png
          19 kB
        8. image-2020-07-06-15-14-44-092.png
          image-2020-07-06-15-14-44-092.png
          25 kB
        9. Forecastimport checks.sql
          0.4 kB

          Issue Links

            Activity

              People

              • Assignee:
                Gareth.Leibbrandt Gareth Leibbrandt (Inactive)
                Reporter:
                will.englefield Will Englefield (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4h Original Estimate - 4h
                  4h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h
                  5h

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.