Merge branch 'master' into velioglu/table_wo_seq_prototype

velioglu/wo_seq_test_1
Burak Velioglu 2022-01-16 17:11:04 +03:00
commit 4ae87e8057
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
6 changed files with 29 additions and 18 deletions

View File

@ -10,13 +10,13 @@
#include "postgres.h"
#include "funcapi.h"
#include "pg_config.h"
#include "access/nbtree.h"
#include "access/table.h"
#include "catalog/pg_am.h"
#include "catalog/pg_type.h"
#include "distributed/pg_version_constants.h"
#include "distributed/tuplestore.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "storage/smgr.h"
@ -54,6 +54,8 @@ columnar_store_memory_stats(PG_FUNCTION_ARGS)
TupleDescInitEntry(tupleDescriptor, (AttrNumber) 3, "WriteStateContext",
INT8OID, -1, 0);
tupleDescriptor = BlessTupleDesc(tupleDescriptor);
MemoryContextCounters transactionCounters = { 0 };
MemoryContextCounters topCounters = { 0 };
MemoryContextCounters writeStateCounters = { 0 };
@ -68,9 +70,9 @@ columnar_store_memory_stats(PG_FUNCTION_ARGS)
Int64GetDatum(writeStateCounters.totalspace)
};
Tuplestorestate *tupleStore = SetupTuplestore(fcinfo, &tupleDescriptor);
tuplestore_putvalues(tupleStore, tupleDescriptor, values, nulls);
PG_RETURN_DATUM(0);
HeapTuple tuple = heap_form_tuple(tupleDescriptor, values, nulls);
PG_RETURN_DATUM(HeapTupleGetDatum(tuple));
}

View File

@ -42,7 +42,6 @@
#include "commands/defrem.h"
#include "commands/sequence.h"
#include "commands/trigger.h"
#include "distributed/metadata_cache.h"
#include "executor/executor.h"
#include "executor/spi.h"
#include "miscadmin.h"

View File

@ -32,6 +32,7 @@
#include "nodes/makefuncs.h"
#include "optimizer/plancat.h"
#include "pgstat.h"
#include "safe_lib.h"
#include "storage/bufmgr.h"
#include "storage/bufpage.h"
#include "storage/bufmgr.h"
@ -48,16 +49,12 @@
#include "utils/relcache.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "columnar/columnar.h"
#include "columnar/columnar_customscan.h"
#include "columnar/columnar_storage.h"
#include "columnar/columnar_tableam.h"
#include "columnar/columnar_version_compat.h"
#include "distributed/commands.h"
#include "distributed/commands/utility_hook.h"
#include "distributed/listutils.h"
#include "distributed/metadata_cache.h"
/*
* Timing parameters for truncate locking heuristics.
@ -2098,7 +2095,9 @@ ColumnarProcessUtility(PlannedStmt *pstmt,
IndexStmt *indexStmt = (IndexStmt *) parsetree;
Relation rel = relation_openrv(indexStmt->relation,
GetCreateIndexRelationLockMode(indexStmt));
indexStmt->concurrent ? ShareUpdateExclusiveLock :
ShareLock);
if (rel->rd_tableam == GetColumnarTableAmRoutine())
{
CheckCitusVersion(ERROR);

View File

@ -1201,6 +1201,15 @@ ExecuteDistributedDDLJob(DDLJob *ddlJob)
* snapshots via adaptive executor.
*/
set_indexsafe_procflags();
/*
* We should not have any CREATE INDEX commands go through the
* local backend as we signaled other backends that this backend
* is executing a "safe" index command (PROC_IN_SAFE_IC), which
* is NOT true, we are only faking postgres based on the reasoning
* given above.
*/
Assert(localExecutionSupported == false);
#endif
}

View File

@ -67,10 +67,11 @@ BEGIN
RETURN false;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION columnar_store_memory_stats()
RETURNS TABLE(TopMemoryContext BIGINT,
TopTransactionContext BIGINT,
WriteStateContext BIGINT)
CREATE OR REPLACE FUNCTION columnar_store_memory_stats(
OUT TopMemoryContext BIGINT,
OUT TopTransactionContext BIGINT,
OUT WriteStateContext BIGINT)
RETURNS RECORD
LANGUAGE C STRICT VOLATILE
AS 'citus', $$columnar_store_memory_stats$$;
CREATE FUNCTION top_memory_context_usage()

View File

@ -73,10 +73,11 @@ BEGIN
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION columnar_store_memory_stats()
RETURNS TABLE(TopMemoryContext BIGINT,
TopTransactionContext BIGINT,
WriteStateContext BIGINT)
CREATE OR REPLACE FUNCTION columnar_store_memory_stats(
OUT TopMemoryContext BIGINT,
OUT TopTransactionContext BIGINT,
OUT WriteStateContext BIGINT)
RETURNS RECORD
LANGUAGE C STRICT VOLATILE
AS 'citus', $$columnar_store_memory_stats$$;