Skip to content

IGNITE-23081 Add lease expiration time to configuration#4376

Merged
vldpyatkov merged 6 commits intoapache:mainfrom
unisonteam:IGNITE-23081
Sep 17, 2024
Merged

IGNITE-23081 Add lease expiration time to configuration#4376
vldpyatkov merged 6 commits intoapache:mainfrom
unisonteam:IGNITE-23081

Conversation

@Cyrill
Copy link
Copy Markdown
Contributor

@Cyrill Cyrill commented Sep 11, 2024

/** The interval in milliseconds that is used in the beginning of lease granting process. */
@Value(hasDefault = true)
@Range(min = 0)
public long agreementAcceptanceInterval = 120_000;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
public long agreementAcceptanceInterval = 120_000;
public long leaseAgreementAcceptanceTimeLimit = 120_000;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed


/** The interval in milliseconds that is used in the beginning of lease granting process. */
@Value(hasDefault = true)
@Range(min = 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It shouldn't be zero, I'd prefer the default of leaseExpirationInterval

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed


/** Lease holding interval. */
@Value(hasDefault = true)
@Range(min = 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It shouldn't be zero, at lease it should be greater (preferable several times) than LeaseUpdater#UPDATE_LEASE_MS (500 ms). I would suggest 2000, but it's discussible. Also we should set the max value, maybe default of leaseAgreementAcceptanceTimeLimit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

HybridTimestamp startTs = clockService.now();

var expirationTs = new HybridTimestamp(startTs.getPhysical() + longLeaseInterval, 0);
long interval = replicationConfiguration.agreementAcceptanceInterval().value();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know how fast the values can be retrieved from configuration, are you sure that we shouldn't get this only once per iteration in #updateLeaseBatchInternal?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@vldpyatkov vldpyatkov merged commit 9d0fac0 into apache:main Sep 17, 2024
@Cyrill Cyrill deleted the IGNITE-23081 branch September 17, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants