Permalink
Browse files

Merge "remove explict vacuum full when below quota"

  • Loading branch information...
2 parents f25fa5f + c68bd80 commit d7a897bdedc6fad7e8f64b7d314946240174722c Frank Lu committed with Gerrit Code Review Nov 28, 2012
View
2 ng/postgresql/lib/postgresql_service/node.rb
@@ -377,7 +377,7 @@ def create_database_user(instance, binduser, quota_exceeded)
#Ignore privileges Initializing error. Log only.
begin
if quota_exceeded then
- # revoke create privilege on database to parent role
+ # revoke create privilege on database from parent role
# In fact, this is a noop, for the create privilege of parent user should be revoked in revoke_write_access when quota is exceeded.
db_connection.query("REVOKE CREATE ON DATABASE #{name} FROM #{user}") unless parent
db_connection.query("REVOKE TEMP ON DATABASE #{name} from #{user}")
View
2 ng/postgresql/lib/postgresql_service/storage_quota.rb
@@ -81,7 +81,7 @@ def enforce_instance_storage_quota(service, database_size=nil)
end
end
rescue => e
- @logger.warn("PostgreSQL Node exception: " + fmt_error(e))
+ @logger.warn("Fail to enforce storage quota for service #{service.name}: " + fmt_error(e))
end
end
View
16 ng/postgresql/lib/postgresql_service/util.rb
@@ -183,15 +183,12 @@ def do_revoke_query(db_connection, user, sys_user)
# Legacy method to grant user privileges of public schema
def exe_grant_user_priv(conn)
- @logger ||= create_logger
- unless conn
- @logger.error("No connection to do exe_grant_user_priv")
- return
- end
- grant_user_priv(conn, pg_version(conn))
- end
- def grant_user_priv(conn, version)
- return unless conn
+ @logger ||= create_logger
+ unless conn
+ @logger.error("No connection to do exe_grant_user_priv")
+ return
+ end
+ version = pg_version(conn)
conn.query("grant create on schema public to public")
if version == '9'
conn.query("grant all on all tables in schema public to public")
@@ -290,7 +287,6 @@ def grant_write_access_internal(db_connection, service, public_schema_id=nil)
if db_connection_sys_user.nil?
@logger.error("Unable to grant write access to #{name} for #{sys_user}")
else
- db_connection_sys_user.query("vacuum full")
db_connection_sys_user.close
do_grant_query(db_connection, user, sys_user)
end

0 comments on commit d7a897b

Please sign in to comment.