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

[Named min timestamp leases] Metric tracking fresh ts shortfall #7402

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ergo14
Copy link
Contributor

@ergo14 ergo14 commented Oct 25, 2024

Non-contentious bits from #7400

@ergo14 ergo14 requested a review from jkozlowski October 25, 2024 15:45
@ergo14 ergo14 force-pushed the aa-nmtl-wiring branch 2 times, most recently from 68962f6 to 69ff52c Compare October 25, 2024 15:54
@ergo14 ergo14 force-pushed the aa-nmtl-shortfall-metric branch from b358204 to 81f7ee9 Compare October 25, 2024 15:57
@ergo14 ergo14 force-pushed the aa-nmtl-shortfall-metric branch from 81f7ee9 to 80ae615 Compare October 25, 2024 16:20
@ergo14 ergo14 changed the base branch from aa-nmtl-wiring to develop October 28, 2024 09:24
@changelog-app
Copy link

changelog-app bot commented Oct 28, 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

[Named min timestamp leases] Metric tracking fresh ts shortfall

Check the box to generate changelog(s)

  • Generate changelog entry

@@ -62,28 +64,38 @@ public final class TimestampLeaseAcquirerImpl implements TimestampLeaseAcquirer
private final NamespacedTimestampLeaseService delegate;
private final Unlocker unlocker;
private final Supplier<UUID> uuidSupplier;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should have asked on earlier review, but what is the purpose of the UUID supplier? We know from the type that it is a UUID supplier 😅

responseMap.get(timestampName).getFreshTimestamps().getCount();
return returnedTimestamps >= requestedTimestamps;
});
long wereNotFullyFulfilled = requestedFreshTimestamps.keySet().stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unfulfilledRequestCount or similar?

unlock(response);
log.info(
"Timestamp lease request was not fully fulfilled. This should happen infrequently.",
SafeArg.of("requests", requests),
SafeArg.of("requests", request),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: makes sense, but change the arg name too.

return new TimestampLeaseAcquirerImpl(
delegate,
identifier -> unlock(unlocker, identifier),
UniqueIds::pseudoRandomUuidV4,
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally in the rest of the code we use UUID::randomUUID. This is plausibly better, but was there a reason for using it here specifically?

timestampLease:
docs: Timestamp lease client side telemetry
metrics:
notEnoughFreshTimestamps:
Copy link
Contributor

Choose a reason for hiding this comment

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

pedantry: I'd probably have instances somewhere in the name, to be explicit that it's not the amount of shortfall that matters in this count

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

Successfully merging this pull request may close these issues.

2 participants