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

Notifying instead of failing fixes #2111 #2112

Merged
merged 6 commits into from
Feb 12, 2015

Conversation

juanignaciosl
Copy link
Contributor

@rambo what do you think about this? I think you told me Redis metadata (behind $table_metadata) is no longer used. There're situations like the reported bug when key (table name) is missing and that caused to fail. I think recovering here is legit. I'm not confident about fully removing Redis table metadata usage yet, that's a whole different story now.

What to test: registration was previously done at Redis, and that's been removed. Everything should work fine. With an eye on Rollbar to avoid adding new errors.

  • Importing.
  • Manual new table.
  • Geocoding.
  • Adding and removing different types of features in a map, and rendering.

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@juanignaciosl
Copy link
Contributor Author

@rambo @Kartones could you please CR this?

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@Kartones
Copy link
Contributor

Kartones commented Feb 9, 2015

+1 and I wonder when we'll fully delete that migrator20.rb and migrator21.rb... probably with 3.0

@zenitraM
Copy link
Contributor

The only user of this is/was the tiler, so probably @rochoa can confirm the Redis keys are not used anymore

@rochoa
Copy link
Contributor

rochoa commented Feb 10, 2015

I'm actually removing old api (/tiles/:table/...), check: CartoDB/Windshaft-cartodb#257

That is using the privacy metadata but since it was already deprecated I don't care too much about those endpoints failing randomly due to that change.

@juanignaciosl
Copy link
Contributor Author

@rochoa : I think we should test this in staging with QA people then so nothing too harmful arises, could you tell me what should we test, related to the tiler? Thanks :-)

@rochoa
Copy link
Contributor

rochoa commented Feb 10, 2015

If table privacy changes from "public" to "private" it will fail to render the tile either because the privacy is not enough (from the redis metadata) or because it has not enough database privileges.

I will double check the different paths and will write here what to test.

@juanignaciosl
Copy link
Contributor Author

Ok, thank you very much. I'll wait for this to continue. I'm sorry for asking, but could you give an ETA? This Redis error is also raised at common data metadata loading. I was waiting to end this task to enable metadata loading, but if it's taking some days I might patch it instead.

@rochoa
Copy link
Contributor

rochoa commented Feb 10, 2015

What's that "Redis error is also raised at common data metadata loading" error? I'm not aware of it.

ETA: I will do it tomorrow. 😄

@juanignaciosl
Copy link
Contributor Author

I'm speaking about #2134, I should've linked it before since I spoke about it, sorry 😅
Tomorrow is great, thanks :-)

@javisantana
Copy link
Contributor

hey, if the old api fails is not a problem

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@juanignaciosl
Copy link
Contributor Author

@rochoa : @Xatpy found a problem in staging (you can check now at ded01) that I've confirmed in local. This branch makes Varnish invalidation stop working, at least at one case. I've checked the changes and it doesn't seem to be a straightforward problem (I mean, I haven't deleted any call to Varnish invalidation), so you can probably help me or, at least, point to me the place where that cache should be invalidated.

Steps to reproduce:

  • Open a map.
  • Create a new polygon with "add new feature" button and "done" for finish.
  • Expected: polygon is added an appears. What happens: polygon won't appear, but if you zoom, it will. It certainly looks like an invalidation issue (it didn't happen when I was not running Varnish locally).

Thank you in advance :)

PD: I'm trying to reproduce it again in local but I just can't. Nevertheless ded01 won't work.

raise 'table privacy cannot be nil' unless privacy
# TODO: Improve this, hack because tiler checks it
$tables_metadata.hset redis_key, 'privacy', privacy_for_redis
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW I would remove the privacy_for_redis method

@zenitraM
Copy link
Contributor

@juanignaciosl let me look at the Varnish issue, it could have been my fault

@rochoa
Copy link
Contributor

rochoa commented Feb 11, 2015

Things I've been testing:

Preconditions:

  • Have a table wadus_table with privacy set to private.
  • You are NOT able to retrieve http://{user}.cartodb.com/tiles/wadus_table/0/0/0.png

Test scenario:

  1. Change privacy in wadus_table from private to public
  2. You CAN retrieve http://{user}.cartodb.com/tiles/wadus_table/0/0/0.png
  3. Change privacy in wadus_table from public back to private
  4. You are NOT able to retrieve http://{user}.cartodb.com/tiles/wadus_table/0/0/0.png

Although we are not hseting the privacy in Redis anymore privacy will continue working because at the end it relies postgres permissions to access the data.

HTH.

@juanignaciosl
Copy link
Contributor Author

@rochoa do you mean that hset of the privacy made it work? :-\

@zenitraM I don't think it's your fault, because rui keeps working.

@rochoa
Copy link
Contributor

rochoa commented Feb 11, 2015

What I mean is that the hset probably was a 'nice to have' thing at the time but it has no effect because it ends relying on database real permission for the user using the table.

@rochoa
Copy link
Contributor

rochoa commented Feb 11, 2015

Have a look at this: #1629

@juanignaciosl
Copy link
Contributor Author

It is similar, but it won't appear, no matter how much I wait.

@rochoa
Copy link
Contributor

rochoa commented Feb 11, 2015

If data changed the {layergroupid}:{last_updated_at} tuple should change so it should not hit anything cached.

Are you using private tables?

@juanignaciosl
Copy link
Contributor Author

I created a new table at both with the defaults for my users, public in staging and private in local, but in local a public one also works. After drawing the polygon I see a difference within two POST requests. This request:
https://juanignaciosl-ded.cartodb-staging.com/api/v1/map?map_key=48d11578f1fce30b3f3a59d131846a99a7f12e37
returns

cdn_url: {http: "api-staging-ded01.cartocdn.com", https: "cartocdn-staging-ded01.global.ssl.fastly.net"}
http: "api-staging-ded01.cartocdn.com"
https: "cartocdn-staging-ded01.global.ssl.fastly.net"
last_updated: "1970-01-01T00:00:00.000Z"
layergroupid: "f4c7eb1388d0fb7cb487c253787af386:0"

but the similar one in local (http://development.localhost.lan/api/v1/map?map_key=cc654eec2c22b45b2a46e4938370530add62a2c5) returns

last_updated: "2015-02-11T15:44:30.368Z"
layergroupid: "79ba7f70276ef1db79c2d9888a26fc1d:1423669470368.13"

In the staging request there's cdn information, and last_updated seems wrong. That request is the last one in staging, in local there're more afterwards that will refresh the content.

@juanignaciosl
Copy link
Contributor Author

For future reference and the rest of you: @rochoa has been helping me with this (thanks!). The problem was ded01 was using a Windshaft version from June. After upgrading it works as expected. Will continue testing then.

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@rochoa
Copy link
Contributor

rochoa commented Feb 11, 2015

Yes, mystery solved! As @juanignaciosl said: Maps API in ded01 machine was running an old version with no x-cache-channel header in layergroups.

Thanks to @zenitraM all staging servers are being deployed, previously only api01-st was being deployed. So I hope no more issues like this inconsistency in staging environment!

@juanignaciosl
Copy link
Contributor Author

Got +1 from QA, I'm merging & deploying.

juanignaciosl added a commit that referenced this pull request Feb 12, 2015
…n_table_rename

Notifying instead of failing fixes #2111
@juanignaciosl juanignaciosl merged commit 1723204 into master Feb 12, 2015
@juanignaciosl juanignaciosl deleted the 2111-Dont_fail_because_of_key_on_table_rename branch August 28, 2015 13:20
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