Skip to content

Failed to "partition_table_concurrently" #153

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

Closed
thamerlan opened this issue Apr 12, 2018 · 6 comments
Closed

Failed to "partition_table_concurrently" #153

thamerlan opened this issue Apr 12, 2018 · 6 comments
Labels

Comments

@thamerlan
Copy link

Problem description

Добрый день.
При попытке сделать partition_table_concurrently очередной таблице, получаю

SELECT partition_table_concurrently ('swmanagement.sessions_history');
ERROR:  cannot start ConcurrentPartWorker
DETAIL:  table is being partitioned now

До этого две другие таблицы успешно прошли пененос данных родительской таблицы.
Таблица сегментирована месяц обратно и ничего в фоне не бежит....
Сделал различные выборки из pathman таблиц:

# select * from pathman_config_params ;
              partrel               | enable_parent | auto |         init_callback          | spawn_using_bgw 
------------------------------------+---------------+------+--------------------------------+-----------------
 swmanagement.sessions_history      | t             | t    | public.pathman_callback(jsonb) | f
...
(8 rows)

# select * from pathman_config;
              partrel               |     expr     | parttype | range_interval |                                                        cooked_expr                                                        
------------------------------------+--------------+----------+----------------+---------------------------------------------------------------------------------------------------------------------------
 swmanagement.sessions_history      | started_at   |        2 | 7 days         | {VAR :varno 1 :varattno 16 :vartype 1114 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 16 :location 8}
...
(8 rows)


# select * from pathman_concurrent_part_tasks;
 userid | pid | dbid | relid | processed | status 
--------+-----+------+-------+-----------+--------
(0 rows)

# select * from pathman_cache_stats;
         context          | size | used | entries 
--------------------------+------+------+---------
 maintenance              |      |      |       0
 partition dispatch cache |      |      |       8
 partition parents cache  |      |      |       0
 partition bounds cache   |      |      |       0
(4 rows)

Environment

      extname       | extowner | extnamespace | extrelocatable | extversion |    extconfig    | extcondition 
--------------------+----------+--------------+----------------+------------+-----------------+--------------
 plpgsql            |       10 |           11 | f              | 1.0        |                 | 
 pg_stat_statements |       10 |         2200 | t              | 1.3        |                 | 
 postgres_fdw       |       10 |         2200 | t              | 1.0        |                 | 
 pgcrypto           |       10 |         2200 | t              | 1.2        |                 | 
 pg_cron            |       10 |         2200 | f              | 1.0        | {350179}        | {""}
 pg_pathman         |       10 |         2200 | f              | 1.4        | {350199,350210} | {"",""}

PostgreSQL 9.5.10 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit

10409

@funbringer
Copy link
Collaborator

  • Проблема воспроизводится каждый раз, или вы только один раз пробовали?
  • Это единственная команда в транзакции?
  • Что показывает запрос select txid_current(), xmin from pathman_config;?

@thamerlan
Copy link
Author

Проблема воспроизводится каждый раз, или вы только один раз пробовали?

Пробовал несколько раз.
Сейчас снова попробовал - тоже самое. Также попробовал эту операцию с другой таблицей и ошибка такая же.
До этого (недели две обратно) всё работало с другими таблицами.

Это единственная команда в транзакции?

Да.

$ psql -c "SELECT partition_table_concurrently ('swmanagement.sessions_history')" 
ERROR:  cannot start ConcurrentPartWorker
DETAIL:  table is being partitioned now

Что показывает запрос select txid_current(), xmin from pathman_config;?

              partrel               | txid_current |    xmin    
------------------------------------+--------------+------------
 swmanagement.sessions_history      |  10705662437 | 4094846849
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4093365572
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4093496109
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4094320836
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4094835417
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4094842058
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4094977856
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |  10705662437 | 4095137443
(8 rows)

@funbringer
Copy link
Collaborator

Окей, я попробую запушать фикс в master, сможете собрать и проверить?

funbringer added a commit to funbringer/pg_pathman that referenced this issue Apr 12, 2018
@thamerlan
Copy link
Author

К сожалению, на текущем env не смогу. Это production.
Если расскажете, как воспроизвести, то могу проверить на других базах.

@funbringer
Copy link
Collaborator

Если расскажете, как воспроизвести, то могу проверить на других базах.

Потребуется воспроизвести wraparound на тестовой базе. Мне бы не хотелось выкатывать новую версию с фиксом, который на самом деле не работает. Я думаю, что починил эту проблему, а вам все равно придется установить новую версию и перезапустить кластер.

@funbringer
Copy link
Collaborator

Предполагаемый фикс попал в 1.4.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants