Github user huor commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1243#discussion_r117661994
--- Diff: src/backend/executor/nodeShareInputScan.c ---
@@ -552,11 +551,59 @@ static void sisc_lockname(char* p, int size, int
share_id, const char* name)
}
}
+
+char * joint_tmp_file_name(ShareInput_Lk_Context *lk_ctxt, char *name)
+{
+ char *tmp_file = palloc(sizeof(char) * MAXPGPATH);
+
+ if(strncmp("writer", name, 7) ==0 )
+ {
+ strncat(tmp_file, lk_ctxt->lkname_ready,
strlen(lk_ctxt->lkname_ready)+1);
+ }
+ else
+ {
+ strncat(tmp_file, lk_ctxt->lkname_done,
strlen(lk_ctxt->lkname_done)+1);
+ }
+ strncat(tmp_file, name, strlen(name)+1);
+ return tmp_file;
+}
+
+void drop_tmp_files(ShareInput_Lk_Context *lk_ctxt)
+{
+ char *writer_tmp_file = NULL;
+ char *reader_tmp_file = NULL;
+
+ writer_tmp_file = joint_tmp_file_name(lk_ctxt, "writer");
+ if(access(writer_tmp_file, F_OK) == 0)
+ {
+ elog(DEBUG3, "Drop writer's tmp files %s in SISC",
writer_tmp_file);
+ unlink(writer_tmp_file);
+ }
+ else
+ {
+ elog(DEBUG3, "Writer's tmp files %s has been dropped already in
SISC", writer_tmp_file);
+ }
+ pfree(writer_tmp_file);
+ reader_tmp_file = joint_tmp_file_name(lk_ctxt, "reader");
--- End diff --
We don't bother to add the handling of reader here as the fix is writer.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---