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

reenabled ghost tables (do not merge) #874

Merged
merged 35 commits into from Nov 6, 2014
Merged

reenabled ghost tables (do not merge) #874

merged 35 commits into from Nov 6, 2014

Conversation

javisantana
Copy link
Contributor

there are some things to review:

  • how the ghost tables task is launched
  • will it work with multiuser
  • the user specs where not working

test to be done

before start

be sure ghost_tables_enabled is true for the user you are testing

create table

  • create a table using SQL API: "create table table_test (test int)"
  • cartodbfy it using the sql api: select cdb_cartodbfytable('table_test')
  • load the dashboard, wait 15 seconds
  • load the dashboard again

the table should be there

drop table

  • load a table using the dashboard
  • drop it using SQL API
  • load the dashboard, wait 15 seconds
  • load the dashboard again

the table should not be there

rename table

  • load a table using the dashboard
  • rename it using SQL API
  • load the dashboard, wait 15 seconds
  • load the dashboard again

the table should not be there

create these tests using a MU account

ideally these tests can be performed using the SQL API and the REST API so they can be automated using python/bash

@xavijam xavijam mentioned this pull request Oct 31, 2014
@javisantana
Copy link
Contributor Author

@rochoa could you check in your local install?

@rochoa
Copy link
Contributor

rochoa commented Nov 4, 2014

I checked it in my local installation and previous issues are fixed. Thanks.

@javisantana
Copy link
Contributor Author

@Kartones code review please. After that @nick13jaremek could you test in staging please?

@@ -18,6 +18,12 @@ def render_jsonp obj, status = 200, options = {}

def link_ghost_tables
return true unless current_user.present?
current_user.link_ghost_tables
if current_user.ghost_tables_enabled && current_user.search_for_modified_table_names
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit afraid that always checking this could be a performance hit, as the check will be executed on every API call (we're crossing at minimum two queries, user real tables and metadata tables).

We can just deploy it and watch the stats, or maybe have a user flag with the timestamp of last ghost tables check, so it doesn'checks and adds again if not past X time (probably just 1h would be enough).

@Kartones
Copy link
Contributor

Kartones commented Nov 4, 2014

Apart from my concern of constantly checking for ghost tables on API calls, the code looks fine +1

@javisantana
Copy link
Contributor Author

@Kartones we could limit to dashboard ones (also this is not enabled for all the users)

@Kartones
Copy link
Contributor

Kartones commented Nov 4, 2014

Well, even in dashboard ones I'd check stats, but that would be much less, yes (and I'd perfectly release it without any timestamp flag)

@javisantana
Copy link
Contributor Author

"timestamp flag" ?

@javisantana
Copy link
Contributor Author

@nick13jaremek don't test this until I change to check this only on dashboard api calls

@Kartones
Copy link
Contributor

Kartones commented Nov 4, 2014

A flag to mark last "register sweep" and avoid any further check until past X time.

But for now restrict to only dashboard API calls and we're good to go, can be changed without problems

this endpoint is called from table too but is ok
@javisantana
Copy link
Contributor Author

@Kartones review my last commit please 365fb09

@Kartones
Copy link
Contributor

Kartones commented Nov 5, 2014

nice!

@javisantana
Copy link
Contributor Author

waiting for CI, will merge it

@saleiva
Copy link
Contributor

saleiva commented Nov 5, 2014

cannot avoid to do a ping on this. :)

@recena
Copy link

recena commented Nov 5, 2014

@saleiva Tests have passed successfully ;)

@javisantana
Copy link
Contributor Author

will deploy tomorrow guys 👯 💃 👯

@recena
Copy link

recena commented Nov 5, 2014

@javisantana tomorrow? cagao ;)

javisantana added a commit that referenced this pull request Nov 6, 2014
@javisantana javisantana merged commit fdc2ffb into master Nov 6, 2014
@andrewxhill
Copy link
Contributor

Hmm... have you seen this before?

screen shot 2014-11-13 at 2 30 49 pm

I get it on trying to register a ghost table

select%20cdb_cartodbfytable(%27ghost_testi%27)

on andrew.cartodb

@javisantana
Copy link
Contributor Author

@andrewxhill yes, that's a problem we have sometimes but it's not related to the cartodby, I will file another ticket: #1150

@elenatorro elenatorro deleted the CDB-2572 branch February 16, 2018 13:40
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.

None yet

6 participants