Skip to content

[scd] Don't disable lock with timeBasedNotificationIndex on yugabyte - #1619

Open
the-glu wants to merge 1 commit into
interuss:masterfrom
Orbitalize:yugabyte_notifindex
Open

[scd] Don't disable lock with timeBasedNotificationIndex on yugabyte#1619
the-glu wants to merge 1 commit into
interuss:masterfrom
Orbitalize:yugabyte_notifindex

Conversation

@the-glu

@the-glu the-glu commented Aug 7, 2026

Copy link
Copy Markdown
Member

Disabling lock with yugabyte result in prober test not passing dues to performance. This enable it back only for yugabyte.

func (c *repo) LockSubscriptionsOnCells(ctx context.Context, cells s2.CellUnion, subscriptionIds []dssmodels.ID, startTime *time.Time, endTime *time.Time) error {

if c.timeBasedNotificationIndex { // No lock when working with timeBasedNotificationIndex
if c.timeBasedNotificationIndex && c.version.Type == sqlstore.CockroachDB { // No lock when working with timeBasedNotificationIndex on CockroachDB

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems very surprising. Isn't the purpose of locking subscriptions to serialize contention between modification of their notification indices? If their notification indices aren't being modified (because of the use of the time-based notification index), why would performance suffer in Yugabyte when we didn't lock the subscriptions while using the time-based notification index? I'm confused as to what mechanism would lead to increased performance in Yugabyte when adding a lock on subscriptions when the time-based notification index was already in use.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We do have fewer datapoints/investigations on Yugabyte than CockroachDB, as Cockroach was the focus, but based on what I know:

  • The subscriptions table still needs to be read, which means that if one query adds a subscription, we still have a form of contention (hence the less-than-expected improvements on CockroachDB with the flag)
  • Yugabyte seems to perform worse than CockroachDB under contention, as of now. I had to fix a few things because we didn't pass performance tests with Yugabyte:

I haven't performed a deep dive into Yugabyte mechanisms, but in general, it seems we need to lock elements correctly to avoid contention performance issues, whereas CockroachDB automatically handles some of these optimizations.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants