Fix raw data job query duplicates.#1800
Merged
aaronweeden merged 1 commit intoubccr:xdmod11.0from Dec 15, 2023
Merged
Conversation
3 tasks
eb3a18e to
7d15428
Compare
7d15428 to
699700a
Compare
eiffel777
approved these changes
Dec 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug just introduced in #1780 in which queries for raw data in the Jobs realm would return duplicates if a single day was requested that contained jobs that span multiple days. For example, if the request's
start_dateandend_datewere both2023-01-03, and a job started on2023-01-01and ended on2023-01-03, the job would be included three times, once each for the aggregation days2023-01-01,2023-01-02, and2023-01-03, because the query does not contain aDISTINCTmodifier orWHEREconditions on theday_idof the aggregation table. This PR adds theWHEREconditions; in the previous example, this means the job is only included once, for the aggregation day2023-01-03. This is sufficient to fix the bug; theDISTINCTmodifier is unnecessary for single-day queries, so it remains omitted for performance.Tests performed
The bug was caught by the regression test changes in #1792. I rebased that branch on this one and confirmed the tests pass again.
This PR causes the jobs to be returned in a different order depending on whether
XDMOD_TEST_MODEisfresh_installorupgrade, so the regression test artifacts are updated. There is also an update to the Cloud realm's artifact because, in between the last time the artifacts were regenerated and now, a change was made totests/regression/runtests.shto search and replace the username hashes with<username>. Since then, the cloud tests have been passing when the actual username hashes were in the file, which is fine, but this PR synchronizes the committed file with what is generated bytests/regression/runtests.shwhenREG_TEST_FORCE_GENERATION=1; namely, replacing the username hashes in the file with<username>.I also did the following on
xdmod-dev:classes/DataWarehouse/Query/Jobs/JobDataset.phpto my dev port asclasses/DataWarehouse/Query/Jobs/JobDatasetOld.php. Change its class name toJobDatasetOld.classes/Rest/Controllers/WarehouseControllerProvider.phpto add araw-data-oldendpoint that callsgetRawDataOld, which is a copy ofgetRawDatathat callsgetRawDataQueryOld, which is a copy ofgetRawDataQuerythat sets$classNameto'\DataWarehouse\Query\Jobs\JobDatasetOld'.'old': 'https://xdmod-dev.ccr.xdmod.org:9001/rest/warehouse/raw-data-old'.Jobs.NUM_TRIALS_PER_REALMto5.--timeargument. Confirm there are no differences.NUM_DAYS_PER_REQUESTto 1:--timeargument. Confirm the number of rows in new is always less than or equal to old, and there are no differences.Checklist: