Skip to content

Fix IllegalArgumentException in TaskLockBox.syncFromStorage() on rolling update#6050

Merged
jihoonson merged 1 commit intoapache:masterfrom
jihoonson:fix-lockbox
Jul 27, 2018
Merged

Fix IllegalArgumentException in TaskLockBox.syncFromStorage() on rolling update#6050
jihoonson merged 1 commit intoapache:masterfrom
jihoonson:fix-lockbox

Conversation

@jihoonson
Copy link
Copy Markdown
Contributor

@jihoonson jihoonson commented Jul 26, 2018

The prioritized locking was introduced in 0.12.0 (#4550). So, when updating a Druid cluster from some old version before 0.12.0 to 0.12.x, both tasks and taskLocks in metastore don't have priority values.

However, this introduces two different priority values for task and taskLock. The priority is an int member variable of TaskLock, so it is initialized to 0 when it's deserialized if priority doesn't exist in the serialized locks. But, the priority is a variable of taskContext in Task, and its default value varies depending on the task type.

This PR fixes this bug as below:

  • Every task submitted via overlord's endpoint is automatically assigned a default priority if the priority doesn't exist in taskContext. The assigned priority is added to taskContext.
  • The tasks and taskLocks in metastore have 0 priority if they don't have the priority.

I modified OverlordTest to check the task has the priority in the context once it is submitted to overlord's endpoint.
Also, I have changed the default priority of NoopTask from 0 to 50. This causes the same exception in TaskLockBoxTest.testSyncFromStorage() without this PR.

This should be included to 0.12.2 since it's a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants