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

Transactional replace should only consider supervisors with appending locks #15220

Merged

Conversation

AmatyaAvadhanula
Copy link
Contributor

A SegmentTransactionReplaceAction must only update the mapping of tasks with append locks that are running concurrently. To ensure this, we return the supervisor id only if it has the taskLockType as APPEND in its context.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@AmatyaAvadhanula AmatyaAvadhanula added this to the 28.0 milestone Oct 20, 2023
@@ -434,6 +438,69 @@ public void testCreateSuspendResumeAndStopSupervisor()
Assert.assertTrue(manager.getSupervisorIds().isEmpty());
}

@Test
public void testGetActiveSupervisorIdForDatasourceWithAppendLock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a lot of fine-grained mocking here that makes the test aware of each and every call being made in the implementation. We should refactor the code so we can avoid such mocking.

@abhishekagarwal87 abhishekagarwal87 merged commit 33fdd77 into apache:master Oct 22, 2023
86 checks passed
LakshSingla pushed a commit to LakshSingla/druid that referenced this pull request Oct 23, 2023
…al replace (apache#15220)

A SegmentTransactionReplaceAction must only update the mapping of tasks with append locks that are running concurrently. To ensure this, we return the supervisor id only if it has the taskLockType as APPEND in its context.
LakshSingla added a commit that referenced this pull request Oct 23, 2023
…al replace (#15220) (#15229)

A SegmentTransactionReplaceAction must only update the mapping of tasks with append locks that are running concurrently. To ensure this, we return the supervisor id only if it has the taskLockType as APPEND in its context.

Co-authored-by: AmatyaAvadhanula <[email protected]>
CaseyPan pushed a commit to CaseyPan/druid that referenced this pull request Nov 17, 2023
…al replace (apache#15220)

A SegmentTransactionReplaceAction must only update the mapping of tasks with append locks that are running concurrently. To ensure this, we return the supervisor id only if it has the taskLockType as APPEND in its context.
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.

2 participants