Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Remove TimestampLeaseAwareTransactionManger #7427

Merged
merged 8 commits into from
Nov 8, 2024

Conversation

kannavkm
Copy link
Contributor

@kannavkm kannavkm commented Nov 6, 2024

General

Before this PR: We used to have the API for getting the leased timestamp as part of the TimestampLeaseAwareTransactionManger interface and have the SnapshotTransactionManager implement this interface. And when using this would would cast it explictly. But turns out the TransactionManager provided to us has layers of indirection which means we cannot cast.

After this PR:

Moves the getLeasedTimestamp as part of the base TransactionManager interface and removes TimestampLeaseAwareTransactionManger
==COMMIT_MSG==
==COMMIT_MSG==

Priority:

Concerns / possible downsides (what feedback would you like?):

Is documentation needed?:

Compatibility

Does this PR create any API breaks (e.g. at the Java or HTTP layers) - if so, do we have compatibility?:

Let me try to reason through on how if we were to change this, how would AEQ break and how we would expect clients of AEQ to break, both during the paths

  1. so, no one implements directly TransactionManager - users either extends AutoDelegate_TransactionManager and implements AutoDelegate_TransactionManager, this means that the AtlasDB library upgrades are going to get blocked for clients that don't use this API.
    1. Verified that this does indeed not break for codepaths that don't hit the specific class, tested it with this RC and an old version of AEQ that used TimestampLeaseAwareTransactionManger on build2 and V1 codepath does not break
  2. If we change this API and AEQ breaks with a compile time error.
    1. But that isn't something we can convert to compile time failure anyways for users of AEQ,
    2. If AEQ isn't upgraded and they use the new features with this version of atlas things are bound to break on RUNTIME and we cannot change that, dependent lib HAS to upgrade to use the changed methods safely.
  3. There are two cases here:
    1. What if AEQ upgrades first with this version and Atlas upgrades later for a service: it would be a runtime failure for users of the V2 codepath and users of V1 would not be affected.
    2. What if Atlas upgrades first with this version and AEQ upgrades later for a service: it would be a runtime failure for users of the V2 codepath and users of V1 would not be affected.

If we decide to do a break of this API down the line then we have to be careful around navigating around it in AEQ after V2 is GA, because that would mean that a break here would definitely cause runtime failures for downstream services, but again I don't see any world in which this would not break, library ABI incompat should always break no matter how we put this.

Does this PR change the persisted format of any data - if so, do we have forward and backward compatibility?:

The code in this PR may be part of a blue-green deploy. Can upgrades from previous versions safely coexist? (Consider restarts of blue or green nodes.):

Does this PR rely on statements being true about other products at a deployment - if so, do we have correct product dependencies on these products (or other ways of verifying that these statements are true)?:

Does this PR need a schema migration?

Testing and Correctness

What, if any, assumptions are made about the current state of the world? If they change over time, how will we find out?:

What was existing testing like? What have you done to improve it?:

If this PR contains complex concurrent or asynchronous code, is it correct? The onus is on the PR writer to demonstrate this.:

If this PR involves acquiring locks or other shared resources, how do we ensure that these are always released?:

Execution

How would I tell this PR works in production? (Metrics, logs, etc.):

Has the safety of all log arguments been decided correctly?:

Will this change significantly affect our spending on metrics or logs?:

How would I tell that this PR does not work in production? (monitors, etc.):

If this PR does not work as expected, how do I fix that state? Would rollback be straightforward?:

If the above plan is more complex than “recall and rollback”, please tag the support PoC here (if it is the end of the week, tag both the current and next PoC):

Scale

Would this PR be expected to pose a risk at scale? Think of the shopping product at our largest stack.:

Would this PR be expected to perform a large number of database calls, and/or expensive database calls (e.g., row range scans, concurrent CAS)?:

Would this PR ever, with time and scale, become the wrong thing to do - and if so, how would we know that we need to do something differently?:

Development Process

Where should we start reviewing?:

If this PR is in excess of 500 lines excluding versions lock-files, why does it not make sense to split it?:

Please tag any other people who should be aware of this PR:
@jeremyk-91
@raiju

@changelog-app
Copy link

changelog-app bot commented Nov 6, 2024

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Remove TimestampLeaseAwareTransactionManger and move getMinLeasedTimestamp to be part of TransactionManager

Check the box to generate changelog(s)

  • Generate changelog entry

Copy link
Contributor

@fsamuel-bs fsamuel-bs left a comment

Choose a reason for hiding this comment

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

Approving for RC

@kannavkm
Copy link
Contributor Author

kannavkm commented Nov 6, 2024

Verified this fixes the problems, we need to decide on the best api to merge this

link = "https://github.com/palantir/atlasdb/pull/7305",
allowedOnPath = ".*/src/test/.*", // Unsafe behavior in tests is ok.
allowlistAnnotations = {ReviewedRestrictedApiUsage.class})
long getLeasedTimestamp(TimestampLeaseName leaseName);
Copy link
Contributor

Choose a reason for hiding this comment

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

getMinLeasedTimestamp? for consistency with other places in the repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense done

@kannavkm
Copy link
Contributor Author

kannavkm commented Nov 7, 2024

Decided that we are just going to merge this through TransactionManager

jkozlowski
jkozlowski previously approved these changes Nov 7, 2024
@jkozlowski jkozlowski dismissed their stale review November 7, 2024 13:41

One more question internally

Copy link
Contributor

@mdaudali mdaudali left a comment

Choose a reason for hiding this comment

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

Approving for testing as discussed internally. I need to think harder about the implications for maintaining and changing this and potential solutions, so as discussed, keep the scope of what would break if we changed this to a minimum.

@bulldozer-bot bulldozer-bot bot merged commit 85b49d3 into develop Nov 8, 2024
21 checks passed
@bulldozer-bot bulldozer-bot bot deleted the kkm/txn-manager-add branch November 8, 2024 10:34
@autorelease3
Copy link

autorelease3 bot commented Nov 8, 2024

Released 0.1189.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants