-
Notifications
You must be signed in to change notification settings - Fork 10
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
Subsription tracking refactoring #215
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вроде должно работать, но можно еще лучше скрыть менеджинг ссылок внутри ProgramAccountsDb
.
Одна из серьезных проблем - подчистка подписок на аккаунты, которые принадлежат программе, но не вошли в запрос, который стригеррил подписку на программу. Думаю, можно вынести в отдельный ишью и там обсудить как лучше сделать.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вроде все хорошо, но есть пара недочетов.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вроде все отлично, парочка final nits так сказать. Отдельная благодарность за комменты.
1. When getAccount info triggers subscription, account key starts being tracked in ProgramAccountsDB, for further transfer of tracking control to owner program. 2. If during subscription attempt for account, it's found that owner program already has cache entry and subscription, then no new account subscription is created, but account key is still added to the list of tracked keys. 3. When getProgramAccouns gets cached, it unsubscribes from all tracked accounts. 4. All accounts, which are being tracked by ProgramAccountsDB, get's served from cache, as long as parent has an active subscription, and do not create their own subscription. 5. When getAccountInfo hits the cache it creates a purge task for itself, and when timer expires, it removes itself from tracked accounts in ProgramAccountsDB, and tries to remove itself from AccountsDB cache, succeeding only if no program filters hold another reference count to it. 6. When getAccountInfo misses the cache, while it's owner still having active subscription, the result is similar to case 3, it fetches account by RPC, puts it into AccountsDB, starts tracking it in ProgramAccountsDB, and doesn't create extra subscription for itself, while still spawning purge task to be removed later. Co-authored-by: Alexander Polakov <a.polakov@zubr.io>
accounts, but starts tracking their reference counts, to prevent
premature removal.
served from cache, as long as parent has an active subscription, and
do not create their own subscription.
itself, and when timer expires, it removes itself from tracked
accounts in ProgramAccountsDB, and tries to remove itself from
AccountsDB cache, succeeding only if no program filters hold another
reference count to it.
active subscription, the result is similar to case 3, it fetches
account by RPC, puts it into AccountsDB, starts tracking it in
ProgramAccountsDB, and doesn't create extra subscription for itself,
while still spawning purge task to be removed later.