Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Professional Cloud Architect All Questions

View all questions & answers for the Professional Cloud Architect exam

Exam Professional Cloud Architect topic 1 question 181 discussion

Actual exam question from Google's Professional Cloud Architect
Question #: 181
Topic #: 1
[All Professional Cloud Architect Questions]

You have a Compute Engine managed instance group that adds and removes Compute Engine instances from the group in response to the load on your application. The instances have a shutdown script that removes REDIS database entries associated with the instance. You see that many database entries have not been removed, and you suspect that the shutdown script is the problem. You need to ensure that the commands in the shutdown script are run reliably every time an instance is shut down. You create a Cloud Function to remove the database entries. What should you do next?

  • A. Modify the shutdown script to wait for 30 seconds before triggering the Cloud Function.
  • B. Do not use the Cloud Function. Modify the shutdown script to restart if it has not completed in 30 seconds.
  • C. Set up a Cloud Monitoring sink that triggers the Cloud Function after an instance removal log message arrives in Cloud Logging.
  • D. Modify the shutdown script to wait for 30 seconds and then publish a message to a Pub/Sub queue.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Tesla
Highly Voted 2 years ago
Actually C is correct but Wrong also in a way .. Sink cannot trigger a cloud function directly. It need Pub/Sub which then will trigger Cloud Function.
upvoted 11 times
...
omermahgoub
Highly Voted 1 year, 11 months ago
The correct answer is C: Set up a Cloud Monitoring sink that triggers the Cloud Function after an instance removal log message arrives in Cloud Logging. In this scenario, you want to ensure that the commands in the shutdown script are run reliably every time an instance is shut down. One way to do this is by setting up a Cloud Monitoring sink that triggers a Cloud Function after an instance removal log message arrives in Cloud Logging. This will allow you to use the Cloud Function to perform the necessary tasks (such as removing database entries) when an instance is shut down, and it will ensure that these tasks are performed reliably and consistently. Option A: Modifying the shutdown script to wait for 30 seconds before triggering the Cloud Function is not a reliable solution, as it relies on the shutdown script being able to run for at least 30 seconds before the instance is shut down.
upvoted 7 times
omermahgoub
1 year, 11 months ago
Option B: Modifying the shutdown script to restart if it has not completed in 30 seconds is also not a reliable solution, as it may not be feasible to restart the script if the instance has already been shut down. Option D: Modifying the shutdown script to wait for 30 seconds and then publish a message to a Pub/Sub queue is not a reliable solution, as it relies on the shutdown script being able to run for at least 30 seconds before the instance is shut down, and it also requires additional infrastructure (a Pub/Sub queue) to be set up and maintained.
upvoted 3 times
...
...
pcamaster
Most Recent 1 month, 3 weeks ago
Selected Answer: C
I'll go for C, even though this scenario should be handled in another way. The reason why REDIS entries are still persisted is possibly caused by the application shutdown being not handled correctly. The shutdown script should first wait for the APP shutdown and only after that trigger the REDIS removal (cloud function). Using cloud monitoring to intercept this situation is an option, but a bit of overkill in my opinion. I would better modify the shutdown script and the app shutdown procedure and only then triggering a CF. Too bad there is no option for this :)
upvoted 1 times
...
Sephethus
5 months ago
You cannot trigger a Cloud Function directly from a Cloud Monitoring sink. Instead, you can set up a Cloud Monitoring alert that sends notifications to a Pub/Sub topic, and then trigger the Cloud Function from that Pub/Sub topic.
upvoted 2 times
...
bruh_1
1 year, 2 months ago
Option C is not an efficient way as it causes delay and complexity. on top of that, you wont be able to trigger a cloud function. Correct answer is option D.
upvoted 1 times
...
[Removed]
1 year, 9 months ago
Selected Answer: C
cCorrect Ans is C
upvoted 1 times
...
samirzubair
1 year, 11 months ago
Correct Ans is C
upvoted 2 times
...
surajkrishnamurthy
1 year, 11 months ago
Selected Answer: C
C Is the Correct Answer
upvoted 2 times
...
megumin
2 years ago
Selected Answer: C
C is ok
upvoted 2 times
...
Mahmoud_E
2 years, 1 month ago
Selected Answer: C
C is the right answer
upvoted 1 times
...
Mahmoud_E
2 years, 1 month ago
Selected Answer: C
c is correct
upvoted 1 times
...
AzureDP900
2 years, 1 month ago
C is right
upvoted 3 times
...
charlie_lee
2 years, 2 months ago
Selected Answer: D
use pub/sub trigger cloud function
upvoted 4 times
...
zellck
2 years, 2 months ago
Selected Answer: C
C is the answer as shutdown script is run based on best effort and not a reliable method. https://cloud.google.com/compute/docs/shutdownscript#limitations Compute Engine executes shutdown scripts only on a best-effort basis. In rare cases, Compute Engine cannot guarantee that the shutdown script will complete.
upvoted 5 times
...
kuboraam
2 years, 2 months ago
Selected Answer: C
C would be the cleanest solution. Although at this time, Cloud Monitoring sink cannot trigger a cloud function directly, it can be done via Pub/Sub. Still better than solution D.
upvoted 4 times
...
ramzez4815
2 years, 2 months ago
Selected Answer: C
C is the correct answer
upvoted 1 times
...
[Removed]
2 years, 2 months ago
Selected Answer: C
C looks not a professional way, but can make sure the work being done.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...