Closed amg-web closed 2 years ago
this is a partitioned table and generally gets created by a delayed_job, you can open up a rails console and run
Messages::Partitioner.process
to create them now.
thanks for fix.
Only remain with the jobs which are in turn but do not processed.
SQL Delayed::Backend::ActiveRecord::Job Load (2.0ms) WITH limited_jobs AS (SELECT id, ROW_NUMBER() OVER () AS row_number FROM (SELECT "delayed_jobs".* FROM "public"."delayed_jobs" WHERE (run_at<='2021-11-23 18:23:19.002533' AND locked_at IS NULL AND next_in_strand=TRUE) AND "delayed_jobs"."priority" BETWEEN 0 AND 10 AND "delayed_jobs"."queue" = 'canvas_queue' ORDER BY "delayed_jobs"."priority" ASC, "delayed_jobs"."run_at" ASC, "delayed_jobs"."id" ASC LIMIT 1 FOR UPDATE SKIP LOCKED) subquery) UPDATE "public"."delayed_jobs" SET locked_by = CASE row_number WHEN 1 THEN 'canvas.d.com:8943' END, locked_at = '2021-11-23 18:23:19.003552' FROM limited_jobs WHERE limited_jobs.id="public"."delayed_jobs".id RETURNING "public"."delayed_jobs".* [production:1 primary]
HOW TO FIX THIS? This job is not processinf even after fixing Messages::Partitioner.process
This is a query to get the jobs that need to be processed next. Several are locked at once when one job worker is ready to pull new jobs, and then the next jobs should be processed in turn when another worker is ready to take up a job. Do you have an example of a job that isn't being processed?
due 3 missing tables like messages_202141 jobs stay in Current Job list, they do not show any errors but never processed. After I use Messages::Partitioner.process new jobs started to work, but old are still in the Current list and stay there and number of not running jobs grows. What shell I do? ![delayed notification processing failed PG_UndefinedTable ERROR_ relation does not exist · Issue #1954 · instructure_canvas-lms - Google Chrome 25 11 2021 8_13_43](https://user-images.githubusercontent.com/22151881/143389501-96dc89e7-955d-4ab9-bb32-6c61f53c2b0c.png)
this is a partitioned table and generally gets created by a delayed_job, you can open up a rails console and run
Messages::Partitioner.process
to create them now.
I have to run it again. why it was not created automatically?
irb(main):002:0> Messages::Partitioner.process
SQL (0.4ms) BEGIN [production:1 deploy]
SQL (0.5ms) SET LOCAL statement_timeout=30000 [production:1 deploy]
SQL (29.7ms) CREATE TABLE "public"."messages_2021_50" (
LIKE "public"."messages" INCLUDING ALL,
CHECK (created_at >= TIMESTAMP '2021-12-13 00:00:00'
AND
created_at < TIMESTAMP '2021-12-20 00:00:00'
)
) INHERITS ("public"."messages")
[production:1 deploy]
SQL (1.2ms) COMMIT [production:1 deploy]
SQL (0.5ms) BEGIN [production:1 deploy]
SQL (0.4ms) SET LOCAL statement_timeout=30000 [production:1 deploy]
SQL (11.8ms) CREATE TABLE "public"."messages_2021_51" (
LIKE "public"."messages" INCLUDING ALL,
CHECK (created_at >= TIMESTAMP '2021-12-20 00:00:00'
AND
created_at < TIMESTAMP '2021-12-27 00:00:00'
)
) INHERITS ("public"."messages")
[production:1 deploy]
SQL (1.0ms) COMMIT [production:1 deploy]
SQL (0.4ms) BEGIN [production:1 deploy]
SQL (0.4ms) SET LOCAL statement_timeout=30000 [production:1 deploy]
SQL (12.2ms) CREATE TABLE "public"."messages_2021_52" (
LIKE "public"."messages" INCLUDING ALL,
CHECK (created_at >= TIMESTAMP '2021-12-27 00:00:00'
AND
created_at < TIMESTAMP '2022-01-03 00:00:00'
)
) INHERITS ("public"."messages")
[production:1 deploy]
SQL (1.1ms) COMMIT [production:1 deploy]
=> []
fixed with help of developer trigger was missing in DB
Delayed jobs stop working with following error. Need help to resolve it .
table messages_2021_42 exists but messages_2021_41 does not.
public | messages | table | admin public | messages_2021_10 | table | postgres public | messages_2021_11 | table | postgres public | messages_2021_12 | table | postgres public | messages_2021_13 | table | postgres public | messages_2021_14 | table | postgres public | messages_2021_15 | table | postgres public | messages_2021_16 | table | postgres public | messages_2021_17 | table | postgres public | messages_2021_18 | table | postgres public | messages_2021_19 | table | postgres public | messages_2021_20 | table | postgres public | messages_2021_21 | table | postgres public | messages_2021_22 | table | postgres public | messages_2021_23 | table | postgres public | messages_2021_24 | table | postgres public | messages_2021_25 | table | postgres public | messages_2021_26 | table | postgres public | messages_2021_27 | table | postgres public | messages_2021_28 | table | postgres public | messages_2021_29 | table | postgres public | messages_2021_30 | table | postgres public | messages_2021_31 | table | postgres public | messages_2021_32 | table | postgres public | messages_2021_33 | table | postgres public | messages_2021_34 | table | postgres public | messages_2021_35 | table | postgres public | messages_2021_36 | table | postgres public | messages_2021_37 | table | postgres public | messages_2021_38 | table | postgres public | messages_2021_39 | table | canvas public | messages_2021_40 | table | canvas public | messages_2021_42 | table | canvas public | messages_2021_43 | table | canvas public | messages_2021_44 | table | canvas public | microsoft_sync_groups | table | canvas