Skip to content
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

Feat/461-473 #491

Merged
merged 7 commits into from
Oct 1, 2021
Merged

Feat/461-473 #491

merged 7 commits into from
Oct 1, 2021

Conversation

hugomrdias
Copy link
Contributor

No description provided.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 29, 2021

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d2632d0
Status: ✅  Deploy successful!
Preview URL: https://9cf56666.nft-storage.pages.dev

View logs

Copy link
Contributor

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

  • How are we dealing with new users/nfts that are created after a sync?
  • How do we sync a deleted NFT?
  • How do we deal with the ordering of inserts to postgres and our foreign key constraints? Is it this?:
    • Insert users
    • Insert auth keys
    • Insert content (normalized from PINS)
    • Insert pins (derived from PINS)
    • Insert uploads (NFTS)
  • What are the tasks that have to be done during the downtime? i.e. after the initial sync has been done, but more data has arrived
    • What time estimate do we have for this?
  • How are we syncing the PINS table? I see no code for this...
  • Can you confirm these are no longer needed:
    • NFTS_IDX can just query upload where user_id = X order by inserted_at DESC etc.
    • FOLLOWUPS we can just query pins where service = 'IpfsCluster' AND status <> Pinned
    • DEALS is FDW & materialized views
    • METRICS query postgres directly for now? yes
    • PINATA_QUEUE we can just query pins where service = 'Pinata' AND status <> Pinned

@@ -40,7 +51,8 @@ CREATE TABLE IF NOT EXISTS auth_key
secret TEXT NOT NULL,
account_id BIGINT NOT NULL REFERENCES account (id),
inserted_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL
updated_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL,
UNIQUE (name, account_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

These can be deleted so they need a deleted_at field and so cannot have this constraint, same as uploads. We can't undelete these - if a user deletes one and then creates a new one with the same name the old one should not start working again.

@alanshaw alanshaw mentioned this pull request Sep 30, 2021
19 tasks
`)
}

run()
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed. I ported it to #496

@alanshaw alanshaw merged commit 56b8697 into main Oct 1, 2021
@alanshaw alanshaw deleted the feat/461-473 branch October 1, 2021 16:02
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.

2 participants