• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to know if a table is NOT loaded
#1
Hi team, here i go again...

I understand that if I get an answer from calling cdb_ping("tablename") then "tablename" is properly loaded and I can work with it.

Question is what happens if:

1 - there is no internet connection when I call cdb_ping("tablename").
2 - there is internet connection but for some reason "tablename" has not been loaded.

I've tried the following code 

    [b]put cdb_ping("tablename") into aux
    answer cdb_result("response")       
[/b]

and in both cases the program seems to get stuck on the cdb_ping function and never reaches cdb_result

As a corollary is there any way to find out if a table isn't loaded?

Many thanks
To ";" or not to ";" that is the question
  Reply
#2
(09-11-2019, 12:42 AM)simon.schvartzman Wrote: Hi team, here i go again...

I understand that if I get an answer from calling cdb_ping("tablename") then "tablename" is properly loaded and I can work with it.

Question is what happens if:

1 - there is no internet connection when I call cdb_ping("tablename").
2 - there is internet connection but for some reason "tablename" has not been loaded.

I've tried the following code 

    [b]put cdb_ping("tablename") into aux
    answer cdb_result("response")       
[/b]

and in both cases the program seems to get stuck on the cdb_ping function and never reaches cdb_result

As a corollary is there any way to find out if a table isn't loaded?

Many thanks


Hi Simon,

Calling cdb_ping(tableName) resolves your tableName validity using underlying methods. Thus, you can not rely on this to verify that you have loaded a table or not. 

  1. If there is no internet connection while calling cdb_ping(), you receive a response of 'No internet available at this time.' There is no delay on this error.
  2. If there is an internet connection, and the table has not been loaded, cdb_ping() reports the response time from the instance that is managing your table.
I would suggest trying cdb_pingNode(). This API talks to the droplet at the lowest level. It is expected to be much faster than cdb_ping() because it does not interrogate the instance. cdb_pingNode() communicates with the droplet only.

We are trying to see what your hard communication time to the region is. Please report back what you get.
  Reply
#3
(09-11-2019, 11:28 PM)mark_talluto Wrote:
(09-11-2019, 12:42 AM)simon.schvartzman Wrote: Hi team, here i go again...

I understand that if I get an answer from calling cdb_ping("tablename") then "tablename" is properly loaded and I can work with it.

Question is what happens if:

1 - there is no internet connection when I call cdb_ping("tablename").
2 - there is internet connection but for some reason "tablename" has not been loaded.

I've tried the following code 

    [b]put cdb_ping("tablename") into aux
    answer cdb_result("response")       
[/b]

and in both cases the program seems to get stuck on the cdb_ping function and never reaches cdb_result

As a corollary is there any way to find out if a table isn't loaded?

Many thanks


Hi Simon,

Calling cdb_ping(tableName) resolves your tableName validity using underlying methods. Thus, you can not rely on this to verify that you have loaded a table or not. 

  1. If there is no internet connection while calling cdb_ping(), you receive a response of 'No internet available at this time.' There is no delay on this error.
  2. If there is an internet connection, and the table has not been loaded, cdb_ping() reports the response time from the instance that is managing your table.
I would suggest trying cdb_pingNode(). This API talks to the droplet at the lowest level. It is expected to be much faster than cdb_ping() because it does not interrogate the instance. cdb_pingNode() communicates with the droplet only.

We are trying to see what your hard communication time to the region is. Please report back what you get.
Hi Mark, please see below my code and the results I got

on mouseUp
   put ""
   initializeCanelaDB
   put cdb_auth("xxx@xxx.com","xxxx","xxxxx") into aux
   cdb_loadTable ("Notifications")
   put the milliseconds into aux
   repeat 5
      put msg & crlf & "cdb_pingNode(): " & cdb_pingNode("Notifications")
      put msg & crlf & "cdb_ping(Notifications): "& cdb_ping("Notifications")
      put msg & crlf & "---------"
   end repeat
   put msg & crlf & "Total elapsed time: " & the milliseconds - aux
end mouseUp

Quote:cdb_ping(Notifications): 974.174023
---------
cdb_pingNode():
cdb_ping(Notifications): 1320.114136
---------
cdb_pingNode():
cdb_ping(Notifications): 857.040882
---------
cdb_pingNode():
cdb_ping(Notifications): 830.114841
---------
cdb_pingNode():
cdb_ping(Notifications): 843.634129
---------
Total elapsed time: 60135


and now replacing cdb_pingNode() by cdb_pingNode("Notifications")


Quote:cdb_pingNode(Notifications): false
cdb_ping(Notifications): 1350.273132
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 1022.816896
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 1668.47682
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 978.23596
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 1000.462055
---------
Total elapsed time: 6312

I'm having a hard time to understand:

1 - why cdb_pingNode() returns nothing
2 - why cdb_pingNode("Notifications") returns false
3 - the response time variations of cdb_ping("Notifications") from a min of 830.114841  to a max of 1668.47682 ( 2x the min)

Am I doing something wrong?
To ";" or not to ";" that is the question
  Reply
#4
Hi Simon,

I modified the firewall to allow ping to work on your region. Please give cdb_pingNode() another try.

The variability in transaction time when doing a cdb_ping() call could be due to the activity level of a given instance. cdbPing() is useful to gauge how available the portion of the region your data is stored. cdb_pingNode() is useful to guage how fast you can get a response from your portion of the region under the best conditions.
  Reply
#5
(09-12-2019, 10:41 PM)mark_talluto Wrote: Hi Simon,

I modified the firewall to allow ping to work on your region. Please give cdb_pingNode() another try.

The variability in transaction time when doing a cdb_ping() call could be due to the activity level of a given instance. cdbPing() is useful to gauge how available the portion of the region your data is stored. cdb_pingNode() is useful to guage how fast you can get a response from your portion of the region under the best conditions.

Thanks Mark, 

New results with cdb_pingNode ()


Quote:cdb_pingNode(): 132.501
cdb_ping(Notifications): 824.40114
---------
cdb_pingNode(): 126.351
cdb_ping(Notifications): 589.275837
---------
cdb_pingNode(): 142.869
cdb_ping(Notifications): 565.644979
---------
cdb_pingNode(): 128.699
cdb_ping(Notifications): 587.082863
---------
cdb_pingNode(): 127.671
cdb_ping(Notifications): 615.654945
---------
Total elapsed time: 4166


and with cdb_pingNode ("Notifications")


Quote:cdb_pingNode(Notifications): false
cdb_ping(Notifications): 1172.601938
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 966.895103
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 936.855078
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 962.046862
---------
cdb_pingNode(Notifications): false
cdb_ping(Notifications): 942.969084
---------
Total elapsed time: 5146

Still getting "false" with cdb_pingNode("Notifications"), and huge variations on cdb_ping("Notifications")

Bottom line: what would you suggest about how to check for data availability before shooting a transaction against such data or sending an error message to the user asking to try again later.
To ";" or not to ";" that is the question
  Reply
#6
I have not forgotten about this thread. Still working on an answer.
  Reply
#7
(09-18-2019, 12:44 AM)mark_talluto Wrote: I have not forgotten about this thread. Still working on an answer.

I fixed the cdb_node() bug. The longer answer to improving performance when you are not geographically near a region is a challenging problem. We have some ideas on how we can bring data closer to you and your customers. For now, lets call this 'Region Extenders'. We are in the early phase of working on this. We are not sure this will work. We can not say for sure if we will release this. But, I think there is a need to work on making data as accessible as possible.
  Reply
#8
Hi Mark, any timeframe to expect a decision? Needless to say I'm here to help with the testings...

Regards
To ";" or not to ";" that is the question
  Reply
#9
(09-25-2019, 05:56 PM)simon.schvartzman Wrote: Hi Mark, any timeframe to expect a decision?  Needless to say I'm here to help with the testings...

Regards

I dare not say. You know how those things can go. We are very optimistic about this being helpful. 
 
Thanks for the offer to try it. If we get it to the stage where it looks good, I will definitely request for people to give a try.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)