Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create per-pipeline ETL locks #10

Merged
merged 5 commits into from
Jan 20, 2017
Merged

Conversation

smgallo
Copy link
Contributor

@smgallo smgallo commented Jan 3, 2017

ETLv2 allows multiple ETL processes to be run concurrently but concurrent executions should not include the same action. To support this, lock files are not solely pid-based but also take into account the names of the actions that are being executed. This allows multiple ETL pipelines to be executed concurrently as long as the actions being performed do not overlap.

Description

A new ETL\LockFile class supports a lock file that contains a PID as well as a unique list of actions to be executed by that process. Prior to obtaining a lock, all ETLv2 lock files are checked to make sure that no running process is executing an action that overlaps the new process. Orphaned files are also cleaned up at this point. Note that a prefix (default of etlv2_) is required to identify ETLv2 lock files since multiple processes can run concurrently.

The ETL overseer script now supports --lock-dir and --lock-file-prefix options. In addition, a new etl section in the portal_settings.ini allows any option available as a command-line argument to be set (command-line options override portal_settings.ini values). For example:

[etl]
lock_dir = '/var/lock/xdmod'
lock_file_prefix = 'etlv2_'

Also implemented ETL\Maintenance\TestAction to facilitate testing. This action allows one of the following operations to be specified: sleep a number of seconds, throw an exception (helps test exception handling including the configurable behavior of continuing or stopping on an exception), echo a string. Additional test actions can be added as needed.

Motivation and Context

Allow parallel ETLv2 pipelines but facilitate identification of possible conflicts, especially when automated.

Tests performed

Tested various configurations:

  1. Single pipeline
  2. Multiple pipelines with no intersecting actions (both pipelines run)
  3. Multiple pipelines with intersection actions (2nd pipeline aborts)
  4. Orphaned lock files left by old processes (lock files are cleaned up)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@smgallo smgallo added this to the v6.6.0 milestone Jan 3, 2017
@smgallo smgallo added the enhancement Enhancement of the functionality of an existing feature label Jan 3, 2017
jsperhac added a commit to jsperhac/xdmod that referenced this pull request Jan 4, 2017
jsperhac added a commit to jsperhac/xdmod that referenced this pull request Jan 6, 2017
jsperhac added a commit to jsperhac/xdmod that referenced this pull request Jan 16, 2017
jsperhac added a commit to jsperhac/xdmod that referenced this pull request Jan 17, 2017
jsperhac added a commit to jsperhac/xdmod that referenced this pull request Jan 17, 2017
…menu:

 - Enable changing of y axis min and max, and log scaling, at one time.
	Clicking OK accepts all changes, clicking Cancel rejects them.
 - Prevent Highcharts Error ubccr#10 by explicitly naming log/linear axis
	type on HC chart update.
 - Filter user inputs to axis minimum value when log is selected.
 - Add support for change stack: anything done in context menu should
	be treated atomically.
 - Destroy context menu after use to prevent memory leaks.
 - Incorporate feedback from eslint linter.
@smgallo smgallo merged commit 3da1722 into ubccr:xdmod6.6 Jan 20, 2017
@smgallo smgallo deleted the etl/per-process-locks branch January 20, 2017 18:12
@smgallo smgallo added the Category:ETL Extract Transform Load label Apr 26, 2017
ryanrath pushed a commit to ryanrath/xdmod that referenced this pull request Apr 27, 2017
…menu:

 - Enable changing of y axis min and max, and log scaling, at one time.
	Clicking OK accepts all changes, clicking Cancel rejects them.
 - Prevent Highcharts Error ubccr#10 by explicitly naming log/linear axis
	type on HC chart update.
 - Filter user inputs to axis minimum value when log is selected.
 - Add support for change stack: anything done in context menu should
	be treated atomically.
 - Destroy context menu after use to prevent memory leaks.
 - Incorporate feedback from eslint linter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:ETL Extract Transform Load enhancement Enhancement of the functionality of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants